Test time range filtering with overwritten recurrence

This commit is contained in:
Unrud 2017-06-09 02:30:39 +02:00 committed by Unrud
parent f9d299fbb9
commit c54196bb72
2 changed files with 62 additions and 0 deletions

View File

@ -0,0 +1,46 @@
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//Mozilla.org/NONSGML Mozilla Calendar V1.1//EN
BEGIN:VTIMEZONE
TZID:Europe/Paris
BEGIN:STANDARD
DTSTART:19701025T030000
RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=10
TZNAME:CET
TZOFFSETFROM:+0200
TZOFFSETTO:+0100
END:STANDARD
BEGIN:DAYLIGHT
DTSTART:19700329T020000
RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=3
TZNAME:CEST
TZOFFSETFROM:+0100
TZOFFSETTO:+0200
END:DAYLIGHT
END:VTIMEZONE
BEGIN:VEVENT
UID:event6
DTSTART;TZID=Europe/Paris:20170601T080000
DTEND;TZID=Europe/Paris:20170601T090000
CREATED:20170601T060000Z
DTSTAMP:20170601T060000Z
LAST-MODIFIED:20170601T060000Z
RRULE:FREQ=DAILY;UNTIL=20170602T060000Z
SUMMARY:event6
TRANSP:OPAQUE
X-MOZ-GENERATION:1
END:VEVENT
BEGIN:VEVENT
UID:event6
RECURRENCE-ID;TZID=Europe/Paris:20170602T080000
DTSTART;TZID=Europe/Paris:20170701T080000
DTEND;TZID=Europe/Paris:20170701T090000
CREATED:20170601T060000Z
DTSTAMP:20170601T060000Z
LAST-MODIFIED:20170601T060000Z
SEQUENCE:1
SUMMARY:event6
TRANSP:OPAQUE
X-MOZ-GENERATION:1
END:VEVENT
END:VCALENDAR

View File

@ -542,6 +542,22 @@ class BaseRequestsMixIn:
assert "href>/calendar.ics/event3.ics</" not in answer assert "href>/calendar.ics/event3.ics</" not in answer
assert "href>/calendar.ics/event4.ics</" not in answer assert "href>/calendar.ics/event4.ics</" not in answer
assert "href>/calendar.ics/event5.ics</" not in answer assert "href>/calendar.ics/event5.ics</" not in answer
answer = self._test_filter(["""
<C:comp-filter name="VCALENDAR">
<C:comp-filter name="VEVENT">
<C:time-range start="20170701T060000Z"/>
</C:comp-filter>
</C:comp-filter>"""], items=6)
# HACK: VObject doesn't match RECURRENCE-ID to recurrences, the
# overwritten recurrence is still used for filtering.
assert "href>/calendar.ics/event6.ics</" in answer
answer = self._test_filter(["""
<C:comp-filter name="VCALENDAR">
<C:comp-filter name="VEVENT">
<C:time-range start="20170701T080000Z"/>
</C:comp-filter>
</C:comp-filter>"""], items=6)
assert "href>/calendar.ics/event6.ics</" not in answer
def test_time_range_filter_events_rrule(self): def test_time_range_filter_events_rrule(self):
"""Report request with time-range filter on events with rrules.""" """Report request with time-range filter on events with rrules."""