Example #1
0
 def test_create_event_without_send(self, _):
     """Test creation of event."""
     person, task, event = self.setup_person_task_event(date(2015, 1, 5))
     person.profile.send_calendar_events = False
     with freeze_time("2015-01-1 12:00:00"):
         common.send_calendar_events()
     self.assertEquals(event.needs_sync, False)
     event = self.get_event(person.id, task.end_date)
     self.assertIsNone(event.last_synced_at)
Example #2
0
 def test_rebuild_existing_event(self, _):
     """Test rebuild of existing synced Calendar Event."""
     person, task, event = self.setup_person_task_event(date(2015, 1, 5))
     event.last_synced_at = datetime(2015, 1, 5, 12, 0, 0)
     with freeze_time("2015-01-01 12:00:00"):
         common.send_calendar_events()
     event = self.get_event(person.id, task.end_date)
     self.assertIsNotNone(event)
     self.assertIsNotNone(self.get_relationship(task.id, event.id))
Example #3
0
 def test_create_event_without_send(self, _):
   """Test creation of event."""
   person, task, event = self.setup_person_task_event(date(2015, 1, 5))
   person.profile.send_calendar_events = False
   with freeze_time("2015-01-1 12:00:00"):
     common.send_calendar_events()
   event = self.get_event(person.id, task.end_date)
   self.assertEquals(event.needs_sync, False)
   self.assertIsNone(event.last_synced_at)
Example #4
0
 def test_rebuild_existing_event(self, _):
   """Test rebuild of existing synced Calendar Event."""
   person, task, event = self.setup_person_task_event(date(2015, 1, 5))
   event.last_synced_at = datetime(2015, 1, 5, 12, 0, 0)
   with freeze_time("2015-01-01 12:00:00"):
     common.send_calendar_events()
   event = self.get_event(person.id, task.end_date)
   self.assertIsNotNone(event)
   self.assertIsNotNone(self.get_relationship(task.id, event.id))
Example #5
0
 def test_event_change_date(self, _):
     """Test rebuild calendar event with changed date."""
     person, task, event = self.setup_person_task_event(date(2015, 1, 5))
     event.last_synced_at = datetime(2015, 1, 5, 12, 0, 0)
     event.external_event_id = "abc"
     task.end_date = date(2015, 1, 6)
     with freeze_time("2015-01-01 12:00:00"):
         common.send_calendar_events()
     self.assertEquals(all_models.CalendarEvent.query.count(), 1)
     event = self.get_event(person.id, task.end_date)
     self.assertIsNotNone(event)
     self.assertIsNotNone(self.get_relationship(task.id, event.id))
Example #6
0
 def test_event_change_date(self, _):
   """Test rebuild calendar event with changed date."""
   person, task, event = self.setup_person_task_event(date(2015, 1, 5))
   event.last_synced_at = datetime(2015, 1, 5, 12, 0, 0)
   event.external_event_id = "abc"
   task.end_date = date(2015, 1, 6)
   with freeze_time("2015-01-01 12:00:00"):
     common.send_calendar_events()
   self.assertEquals(all_models.CalendarEvent.query.count(), 1)
   event = self.get_event(person.id, task.end_date)
   self.assertIsNotNone(event)
   self.assertIsNotNone(self.get_relationship(task.id, event.id))