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:
parent
e060bb3d8b
commit
7678da7926
@ -20,12 +20,38 @@ END:DAYLIGHT
|
|||||||
END:VTIMEZONE
|
END:VTIMEZONE
|
||||||
BEGIN:VEVENT
|
BEGIN:VEVENT
|
||||||
UID:event7
|
UID:event7
|
||||||
|
DTSTART;TZID=Europe/Paris:20170701T080000
|
||||||
|
DTEND;TZID=Europe/Paris:20170701T090000
|
||||||
|
CREATED:20170601T060000Z
|
||||||
|
DTSTAMP:20170601T060000Z
|
||||||
|
LAST-MODIFIED:20170601T060000Z
|
||||||
|
RRULE:FREQ=DAILY
|
||||||
|
SUMMARY:event7
|
||||||
|
TRANSP:OPAQUE
|
||||||
|
X-MOZ-GENERATION:1
|
||||||
|
END:VEVENT
|
||||||
|
BEGIN:VEVENT
|
||||||
|
UID:event7
|
||||||
|
RECURRENCE-ID;TZID=Europe/Paris:20170702T080000
|
||||||
|
DTSTART;TZID=Europe/Paris:20170702T080000
|
||||||
|
DTEND;TZID=Europe/Paris:20170702T080000
|
||||||
|
CREATED:20170601T060000Z
|
||||||
|
DTSTAMP:20170601T060000Z
|
||||||
|
LAST-MODIFIED:20170601T060000Z
|
||||||
|
SEQUENCE:1
|
||||||
|
SUMMARY:event7
|
||||||
|
TRANSP:OPAQUE
|
||||||
|
X-MOZ-GENERATION:1
|
||||||
|
END:VEVENT
|
||||||
|
BEGIN:VEVENT
|
||||||
|
UID:event7
|
||||||
|
RECURRENCE-ID;TZID=Europe/Paris:20170703T080000
|
||||||
DTSTART;TZID=Europe/Paris:20170601T080000
|
DTSTART;TZID=Europe/Paris:20170601T080000
|
||||||
DTEND;TZID=Europe/Paris:20170601T090000
|
DTEND;TZID=Europe/Paris:20170601T090000
|
||||||
CREATED:20170601T060000Z
|
CREATED:20170601T060000Z
|
||||||
DTSTAMP:20170601T060000Z
|
DTSTAMP:20170601T060000Z
|
||||||
LAST-MODIFIED:20170601T060000Z
|
LAST-MODIFIED:20170601T060000Z
|
||||||
RDATE;TZID=Europe/Paris:20170701T080000
|
SEQUENCE:1
|
||||||
SUMMARY:event7
|
SUMMARY:event7
|
||||||
TRANSP:OPAQUE
|
TRANSP:OPAQUE
|
||||||
X-MOZ-GENERATION:1
|
X-MOZ-GENERATION:1
|
||||||
|
33
radicale/tests/static/event8.ics
Normal file
33
radicale/tests/static/event8.ics
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
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:event8
|
||||||
|
DTSTART;TZID=Europe/Paris:20170601T080000
|
||||||
|
DTEND;TZID=Europe/Paris:20170601T090000
|
||||||
|
CREATED:20170601T060000Z
|
||||||
|
DTSTAMP:20170601T060000Z
|
||||||
|
LAST-MODIFIED:20170601T060000Z
|
||||||
|
RDATE;TZID=Europe/Paris:20170701T080000
|
||||||
|
SUMMARY:event8
|
||||||
|
TRANSP:OPAQUE
|
||||||
|
X-MOZ-GENERATION:1
|
||||||
|
END:VEVENT
|
||||||
|
END:VCALENDAR
|
@ -687,24 +687,35 @@ 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
|
||||||
|
# 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(["""
|
answer = self._test_filter(["""
|
||||||
<C:comp-filter name="VCALENDAR">
|
<C:comp-filter name="VCALENDAR">
|
||||||
<C:comp-filter name="VEVENT">
|
<C:comp-filter name="VEVENT">
|
||||||
<C:time-range start="20170701T060000Z"/>
|
<C:time-range start="20170701T060000Z"/>
|
||||||
</C:comp-filter>
|
</C:comp-filter>
|
||||||
</C:comp-filter>"""], items=(6, 7))
|
</C:comp-filter>"""], items=(6, 7, 8))
|
||||||
# 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
|
assert "href>/calendar.ics/event6.ics</" in answer
|
||||||
assert "href>/calendar.ics/event7.ics</" in answer
|
assert "href>/calendar.ics/event7.ics</" in answer
|
||||||
|
assert "href>/calendar.ics/event8.ics</" in answer
|
||||||
answer = self._test_filter(["""
|
answer = self._test_filter(["""
|
||||||
<C:comp-filter name="VCALENDAR">
|
<C:comp-filter name="VCALENDAR">
|
||||||
<C:comp-filter name="VEVENT">
|
<C:comp-filter name="VEVENT">
|
||||||
<C:time-range start="20170701T080000Z"/>
|
<C:time-range start="20170701T080000Z"/>
|
||||||
</C:comp-filter>
|
</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/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):
|
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."""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user