예제 #1
0
 def tearDown(self):
     """Tear down test fixture for each functional test method."""
     DBSession.close()
     daemons.execute_in_thread('radicale', lambda: transaction.commit())
     teardown_db()
     transaction.commit()
     DBSession.close_all()
     config['tg.app_globals'].sa_engine.dispose()
예제 #2
0
파일: __init__.py 프로젝트: norsig/tracim
 def tearDown(self):
     """Tear down test fixture for each functional test method."""
     DBSession.close()
     daemons.execute_in_thread('radicale', lambda: transaction.commit())
     teardown_db()
     transaction.commit()
     DBSession.close_all()
     config['tg.app_globals'].sa_engine.dispose()
예제 #3
0
    def test_func__event_create__ok__nominal_case(self):
        lawrence = DBSession.query(User).filter(
            User.email == '*****@*****.**'
        ).one()
        radicale_base_url = CalendarManager.get_base_url()
        client = caldav.DAVClient(
            radicale_base_url,
            username='******',
            password='******'
        )
        user_calendar_url = CalendarManager.get_user_calendar_url(
            lawrence.user_id
        )
        user_calendar = caldav.Calendar(
            parent=client,
            client=client,
            url=user_calendar_url
        )

        event_ics = """BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//Example Corp.//CalDAV Client//EN
BEGIN:VEVENT
UID:1234567890
DTSTAMP:20100510T182145Z
DTSTART:20100512T170000Z
DTEND:20100512T180000Z
SUMMARY:This is an event
LOCATION:Here
END:VEVENT
END:VCALENDAR
"""
        user_calendar.add_event(event_ics)
        user_calendar.save()

        daemons.execute_in_thread('radicale', lambda: transaction.commit())
        # TODO - 20160606 - Bastien: lock should be better here ?
        time.sleep(3)  # Wait for be sure transaction commited in daemon
        transaction.commit()
        try:
            event = DBSession.query(Content) \
                .filter(Content.label == 'This is an event') \
                .filter(Content.owner_id == lawrence.user_id) \
                .filter(Content.id == ContentRevisionRO.content_id) \
                .one()
        except NoResultFound:
            ok_(False, 'Content record should exist for '
                       '"This is an event" label')

        eq_(event.properties['location'], 'Here')
        eq_(event.properties['start'], '2010-05-12 18:00:00+0000')
        eq_(event.properties['end'], '2010-05-12 17:00:00+0000')
예제 #4
0
파일: __init__.py 프로젝트: Nonolost/tracim
 def tearDown(self):
     """Tear down test fixture for each functional test method."""
     DBSession.close()
     daemons.execute_in_thread('radicale', lambda: transaction.commit())
     teardown_db()
예제 #5
0
 def tearDown(self):
     """Tear down test fixture for each functional test method."""
     DBSession.close()
     daemons.execute_in_thread('radicale', lambda: transaction.commit())
     teardown_db()