Beispiel #1
0
class PusherTest(TestCase):
    def setUp(self):
        super(PusherTest, self).setUp()

        connection.cursor().execute(CREATE_PUSH_TABLE)

        now = datetime.now()
        tomorrow = now + timedelta(days=1)

        self.test_event = TestPushEvent(start_date=now.date(),
                                        start_time=now.time(),
                                        title='Test Event',
                                        end_date=tomorrow.date(),
                                        end_time=tomorrow.time())

        self.test_event.save()

        self.pusher = Pusher(self.test_event)

    def tearDown(self):
        connection.cursor().execute("DROP TABLE gcalsync_testpushevent")
        service = Connection().get_service()
        service.events().delete(calendarId='primary',
                                eventId=self.created_event['id']).execute()

    def test_create_event(self):
        self.created_event = self.pusher.create_or_update()
Beispiel #2
0
class PusherTest(TestCase):
    def setUp(self):
        super(PusherTest, self).setUp()
        connection.cursor().execute("DROP TABLE gcalsync_testpushevent")
        connection.cursor().execute(CREATE_PUSH_TABLE)

        now = datetime.now()
        tomorrow = now + timedelta(days=1)

        self.test_event = TestPushEvent(
            start_date=now.date(),
            start_time=now.time(),
            title='Test Event',
            end_date=tomorrow.date(),
            end_time=tomorrow.time())

        self.test_event.save()

        self.pusher = Pusher(self.test_event)

    def tearDown(self):
        connection.cursor().execute("DROP TABLE gcalsync_testpushevent")
        service = Connection().get_service()
        service.events().delete(calendarId='primary', eventId=self.created_event['id']).execute()

    def test_create_event(self):
        self.created_event = self.pusher.create_or_update()
Beispiel #3
0
    def setUp(self):
        super(PusherTest, self).setUp()

        connection.cursor().execute(CREATE_PUSH_TABLE)

        now = datetime.now()
        tomorrow = now + timedelta(days=1)

        self.test_event = TestPushEvent(start_date=now.date(),
                                        start_time=now.time(),
                                        title='Test Event',
                                        end_date=tomorrow.date(),
                                        end_time=tomorrow.time())

        self.test_event.save()

        self.pusher = Pusher(self.test_event)
Beispiel #4
0
    def setUp(self):
        super(PusherTest, self).setUp()
        connection.cursor().execute("DROP TABLE gcalsync_testpushevent")
        connection.cursor().execute(CREATE_PUSH_TABLE)

        now = datetime.now()
        tomorrow = now + timedelta(days=1)

        self.test_event = TestPushEvent(
            start_date=now.date(),
            start_time=now.time(),
            title='Test Event',
            end_date=tomorrow.date(),
            end_time=tomorrow.time())

        self.test_event.save()

        self.pusher = Pusher(self.test_event)