Merge branch 'master' of github.com:Kozea/Radicale
This commit is contained in:
commit
5d7e3ce2b4
@ -311,8 +311,7 @@ def _time_range_match(vobject_item, filter_, child_name):
|
|||||||
return True
|
return True
|
||||||
|
|
||||||
elif child_name == "VJOURNAL":
|
elif child_name == "VJOURNAL":
|
||||||
dtstart = getattr(child, "dstart", None)
|
dtstart = getattr(child, "dtstart", None)
|
||||||
|
|
||||||
if dtstart is not None:
|
if dtstart is not None:
|
||||||
dtstart = dtstart.value
|
dtstart = dtstart.value
|
||||||
if not isinstance(dtstart, datetime):
|
if not isinstance(dtstart, datetime):
|
||||||
@ -322,7 +321,6 @@ def _time_range_match(vobject_item, filter_, child_name):
|
|||||||
.replace(tzinfo=timezone.utc))
|
.replace(tzinfo=timezone.utc))
|
||||||
else:
|
else:
|
||||||
dtstart_is_datetime = True
|
dtstart_is_datetime = True
|
||||||
|
|
||||||
if dtstart_is_datetime:
|
if dtstart_is_datetime:
|
||||||
# Line 1
|
# Line 1
|
||||||
return start <= dtstart and end > dtstart
|
return start <= dtstart and end > dtstart
|
||||||
|
@ -8,16 +8,23 @@ BEGIN:DAYLIGHT
|
|||||||
TZOFFSETFROM:+0100
|
TZOFFSETFROM:+0100
|
||||||
TZOFFSETTO:+0200
|
TZOFFSETTO:+0200
|
||||||
TZNAME:CEST
|
TZNAME:CEST
|
||||||
DTSTART:19700329T020000
|
DTSTART:19700101T000000
|
||||||
RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=3
|
RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=3
|
||||||
END:DAYLIGHT
|
END:DAYLIGHT
|
||||||
BEGIN:STANDARD
|
BEGIN:STANDARD
|
||||||
TZOFFSETFROM:+0200
|
TZOFFSETFROM:+0200
|
||||||
TZOFFSETTO:+0100
|
TZOFFSETTO:+0100
|
||||||
TZNAME:CET
|
TZNAME:CET
|
||||||
DTSTART:19701025T030000
|
DTSTART:19700101T000000
|
||||||
RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=10
|
RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=10
|
||||||
END:STANDARD
|
END:STANDARD
|
||||||
END:VTIMEZONE
|
END:VTIMEZONE
|
||||||
|
|
||||||
|
BEGIN:VJOURNAL
|
||||||
|
UID:journal1
|
||||||
|
DTSTAMP;TZID=Europe/Paris:19940817T000000
|
||||||
|
SUMMARY:happy new year
|
||||||
|
DESCRIPTION: Happy new year 2000 !
|
||||||
|
END:VJOURNAL
|
||||||
|
|
||||||
END:VCALENDAR
|
END:VCALENDAR
|
||||||
|
@ -20,4 +20,12 @@ RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=10
|
|||||||
END:STANDARD
|
END:STANDARD
|
||||||
END:VTIMEZONE
|
END:VTIMEZONE
|
||||||
|
|
||||||
|
BEGIN:VJOURNAL
|
||||||
|
UID:journal2
|
||||||
|
DTSTAMP:19950817T000000
|
||||||
|
DTSTART;TZID=Europe/Paris:20000101T100000
|
||||||
|
SUMMARY:happy new year
|
||||||
|
DESCRIPTION: Happy new year 2001 !
|
||||||
|
END:VJOURNAL
|
||||||
|
|
||||||
END:VCALENDAR
|
END:VCALENDAR
|
||||||
|
@ -20,4 +20,12 @@ RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=10
|
|||||||
END:STANDARD
|
END:STANDARD
|
||||||
END:VTIMEZONE
|
END:VTIMEZONE
|
||||||
|
|
||||||
|
BEGIN:VJOURNAL
|
||||||
|
UID:journal2
|
||||||
|
DTSTAMP:19950817T000000
|
||||||
|
DTSTART;VALUE=DATE:20000101
|
||||||
|
SUMMARY:happy new year
|
||||||
|
DESCRIPTION: Happy new year 2001 !
|
||||||
|
END:VJOURNAL
|
||||||
|
|
||||||
END:VCALENDAR
|
END:VCALENDAR
|
||||||
|
@ -401,6 +401,49 @@ class BaseRequests:
|
|||||||
#~ assert "href>/calendar.ics/todo7.ics</" not in answer
|
#~ assert "href>/calendar.ics/todo7.ics</" not in answer
|
||||||
#~ assert "href>/calendar.ics/todo8.ics</" in answer
|
#~ assert "href>/calendar.ics/todo8.ics</" in answer
|
||||||
|
|
||||||
|
answer = self._test_filter(["""
|
||||||
|
<C:comp-filter name="VCALENDAR">
|
||||||
|
<C:comp-filter name="VJOURNAL">
|
||||||
|
<C:time-range start="19991229T000000Z" end="20000202T000000Z"/>
|
||||||
|
</C:comp-filter>
|
||||||
|
</C:comp-filter>"""], "journal", events=3)
|
||||||
|
assert "href>/calendar.ics/journal1.ics</" not in answer
|
||||||
|
assert "href>/calendar.ics/journal2.ics</" in answer
|
||||||
|
assert "href>/calendar.ics/journal3.ics</" in answer
|
||||||
|
|
||||||
|
|
||||||
|
answer = self._test_filter(["""
|
||||||
|
<C:comp-filter name="VCALENDAR">
|
||||||
|
<C:comp-filter name="VJOURNAL">
|
||||||
|
<C:time-range start="19981229T000000Z" end="19991012T000000Z"/>
|
||||||
|
</C:comp-filter>
|
||||||
|
</C:comp-filter>"""], "journal", events=3)
|
||||||
|
assert "href>/calendar.ics/journal1.ics</" not in answer
|
||||||
|
assert "href>/calendar.ics/journal2.ics</" not in answer
|
||||||
|
assert "href>/calendar.ics/journal3.ics</" not in answer
|
||||||
|
|
||||||
|
answer = self._test_filter(["""
|
||||||
|
<C:comp-filter name="VCALENDAR">
|
||||||
|
<C:comp-filter name="VJOURNAL">
|
||||||
|
<C:time-range start="20131229T000000Z" end="21520202T000000Z"/>
|
||||||
|
</C:comp-filter>
|
||||||
|
</C:comp-filter>"""], "journal", events=3)
|
||||||
|
assert "href>/calendar.ics/journal1.ics</" not in answer
|
||||||
|
assert "href>/calendar.ics/journal2.ics</" not in answer
|
||||||
|
assert "href>/calendar.ics/journal3.ics</" not in answer
|
||||||
|
|
||||||
|
|
||||||
|
answer = self._test_filter(["""
|
||||||
|
<C:comp-filter name="VCALENDAR">
|
||||||
|
<C:comp-filter name="VJOURNAL">
|
||||||
|
<C:time-range start="20000101T000000Z" end="20000202T000000Z"/>
|
||||||
|
</C:comp-filter>
|
||||||
|
</C:comp-filter>"""], "journal", events=3)
|
||||||
|
assert "href>/calendar.ics/journal1.ics</" not in answer
|
||||||
|
assert "href>/calendar.ics/journal2.ics</" in answer
|
||||||
|
assert "href>/calendar.ics/journal3.ics</" in answer
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class TestMultiFileSystem(BaseRequests, BaseTest):
|
class TestMultiFileSystem(BaseRequests, BaseTest):
|
||||||
"""Base class for filesystem tests."""
|
"""Base class for filesystem tests."""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user