Test unordered recurrences

Time range matching stops early when the visited time range is behind the end date of the filter.
Components are visited in the order, in which they are specified in the VCALENDAR.
This can cause problems with overwritten recurrences.
This commit is contained in:
Unrud 2017-08-03 19:47:00 +02:00
parent e060bb3d8b
commit 7678da7926
3 changed files with 76 additions and 6 deletions

View file

@ -687,24 +687,35 @@ class BaseRequestsMixIn:
assert "href>/calendar.ics/event3.ics</" not in answer
assert "href>/calendar.ics/event4.ics</" not in answer
assert "href>/calendar.ics/event5.ics</" not in answer
# HACK: VObject doesn't match RECURRENCE-ID to recurrences, the
# overwritten recurrence is still used for filtering.
answer = self._test_filter(["""
<C:comp-filter name="VCALENDAR">
<C:comp-filter name="VEVENT">
<C:time-range start="20170601T063000Z" end="20170601T070000Z"/>
</C:comp-filter>
</C:comp-filter>"""], items=(6, 7, 8))
assert "href>/calendar.ics/event6.ics</" in answer
assert "href>/calendar.ics/event7.ics</" in answer
assert "href>/calendar.ics/event8.ics</" 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, 7))
# HACK: VObject doesn't match RECURRENCE-ID to recurrences, the
# overwritten recurrence is still used for filtering.
</C:comp-filter>"""], items=(6, 7, 8))
assert "href>/calendar.ics/event6.ics</" in answer
assert "href>/calendar.ics/event7.ics</" in answer
assert "href>/calendar.ics/event8.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, 7))
</C:comp-filter>"""], items=(6, 7, 8))
assert "href>/calendar.ics/event6.ics</" not in answer
assert "href>/calendar.ics/event7.ics</" not in answer
assert "href>/calendar.ics/event7.ics</" in answer
assert "href>/calendar.ics/event8.ics</" not in answer
def test_time_range_filter_events_rrule(self):
"""Report request with time-range filter on events with rrules."""