Ejemplo n.º 1
0
 def test_occurrences_after_with_events_before_returns_empty(self):
     calendar = Calendar()
     calendar.save()
     start_after = timezone.now() + datetime.timedelta(days=-1)
     end_after = start_after + datetime.timedelta(hours=1)
     event = self.__create_event(start_after, end_after)
     calendar.events.add(event)
     occurrences = list(calendar.occurrences_after(timezone.now()))
     self.assertEqual(occurrences, [])
Ejemplo n.º 2
0
 def test_occurrences_after_with_events_after_returns_events(self):
     calendar = Calendar()
     calendar.save()
     start_after = timezone.now() + datetime.timedelta(days=1)
     end_after = start_after + datetime.timedelta(hours=1)
     event = self.__create_event(start_after, end_after)
     calendar.events.add(event)
     occurrences = list(calendar.occurrences_after(timezone.now()))
     self.assertEquals(len(occurrences), 1)
     self.assertEquals(occurrences[0].start, start_after)
     self.assertEquals(occurrences[0].end, end_after)
Ejemplo n.º 3
0
 def test_occurrences_after_with_events_after_returns_events(self):
     calendar = Calendar()
     calendar.save()
     start_after = timezone.now() + datetime.timedelta(days=1)
     end_after = start_after + datetime.timedelta(hours=1)
     event = self.__create_event(start_after, end_after)
     calendar.events.add(event)
     occurrences = list(calendar.occurrences_after(timezone.now()))
     self.assertEquals(len(occurrences), 1)
     self.assertEquals(occurrences[0].start, start_after)
     self.assertEquals(occurrences[0].end, end_after)
Ejemplo n.º 4
0
 def test_occurrences_after_without_events_is_empty(self):
     calendar = Calendar()
     self.assertEqual(list(calendar.occurrences_after(timezone.now())), [])
Ejemplo n.º 5
0
 def test_occurrences_after_without_events_is_empty(self):
     calendar = Calendar()
     self.assertEqual(list(calendar.occurrences_after(timezone.now())), [])