示例#1
0
    def test_occurring_on_with_all_day_event(self):
        """
        Test an all-day event is returned for a call to occuring on.
        """
        time = datetime(2006, 10, 28, tzinfo=TZ)
        all_day = SingleOccurrenceEntry("fakeId", TITLE, DESCRIPTION,
            REMIND, UPDATED, time, 86400, LOCATION, self.cal)

        events = all_day.get_events_occurring_on(time)
        self.assertEquals(1, len(events))
示例#2
0
    def test_occurring_on_all_day_event_tomorrow(self):
        """
        Test that an all day event is not returned when querying the previous
        day.
        """
        time = datetime(2006, 10, 28, tzinfo=TZ)
        all_day = SingleOccurrenceEntry("fakeId", TITLE, DESCRIPTION,
            REMIND, UPDATED, time, 86400, LOCATION, self.cal)

        events = all_day.get_events_occurring_on(time - timedelta(days=1))
        self.assertEquals(0, len(events))
示例#3
0
    def test_occurring_on_with_multi_day_event(self):
        """
        Test a multi-day event that starts before and ends after the date
        queried.
        """
        query_date = datetime(2006, 10, 26, tzinfo=TZ)
        event_start = datetime(2006, 10, 20, tzinfo=TZ)
        event_duration = 60 * 60 * 24 * 14 # two weeks

        vacation = SingleOccurrenceEntry("fakeId", TITLE, DESCRIPTION,
            REMIND, UPDATED, event_start, event_duration, LOCATION, self.cal)

        events = vacation.get_events_occurring_on(query_date)
        self.assertEquals(1, len(events))