diff --git a/radicale/xmlutils.py b/radicale/xmlutils.py
index 93c2860e..20ea826b 100644
--- a/radicale/xmlutils.py
+++ b/radicale/xmlutils.py
@@ -304,13 +304,14 @@ def _time_range_match(vobject_item, filter_, child_name):
completed = completed.value
return start <= completed and end >= completed
elif created is not None:
+ # Line 7
created = created.value
- return end < created
+ return end > created
else:
return True
elif child_name == "VJOURNAL":
- dtstart = getattr(child, "dstart", None)
+ dtstart = getattr(child, "dtstart", None)
if dtstart is not None:
dtstart = dtstart.value
if not isinstance(dtstart, datetime):
diff --git a/tests/static/journal1.ics b/tests/static/journal1.ics
index 5a1eecad..ab458337 100644
--- a/tests/static/journal1.ics
+++ b/tests/static/journal1.ics
@@ -8,16 +8,23 @@ BEGIN:DAYLIGHT
TZOFFSETFROM:+0100
TZOFFSETTO:+0200
TZNAME:CEST
-DTSTART:19700329T020000
+DTSTART:19700101T000000
RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=3
END:DAYLIGHT
BEGIN:STANDARD
TZOFFSETFROM:+0200
TZOFFSETTO:+0100
TZNAME:CET
-DTSTART:19701025T030000
+DTSTART:19700101T000000
RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=10
END:STANDARD
END:VTIMEZONE
+BEGIN:VJOURNAL
+UID:journal1
+DTSTAMP;TZID=Europe/Paris:19940817T000000
+SUMMARY:happy new year
+DESCRIPTION: Happy new year 2000 !
+END:VJOURNAL
+
END:VCALENDAR
diff --git a/tests/static/journal2.ics b/tests/static/journal2.ics
index 5a1eecad..336499b5 100644
--- a/tests/static/journal2.ics
+++ b/tests/static/journal2.ics
@@ -20,4 +20,12 @@ RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=10
END:STANDARD
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
diff --git a/tests/static/journal3.ics b/tests/static/journal3.ics
index 5a1eecad..a319d3a2 100644
--- a/tests/static/journal3.ics
+++ b/tests/static/journal3.ics
@@ -20,4 +20,12 @@ RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=10
END:STANDARD
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
diff --git a/tests/static/todo1.ics b/tests/static/todo1.ics
index 8005238f..991fcd75 100644
--- a/tests/static/todo1.ics
+++ b/tests/static/todo1.ics
@@ -20,6 +20,7 @@ RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=10
END:STANDARD
END:VTIMEZONE
BEGIN:VTODO
-
+DTSTART;TZID=Europe/Paris:20130901T180000
+DURATION:PT1H
END:VTODO
END:VCALENDAR
diff --git a/tests/static/todo2.ics b/tests/static/todo2.ics
index 8005238f..e4b3badc 100644
--- a/tests/static/todo2.ics
+++ b/tests/static/todo2.ics
@@ -20,6 +20,7 @@ RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=10
END:STANDARD
END:VTIMEZONE
BEGIN:VTODO
-
+DTSTART;TZID=Europe/Paris:20130901T180000
+DUE;TZID=Europe/Paris:20130903T180000
END:VTODO
END:VCALENDAR
diff --git a/tests/static/todo3.ics b/tests/static/todo3.ics
index 8005238f..fb29bc15 100644
--- a/tests/static/todo3.ics
+++ b/tests/static/todo3.ics
@@ -20,6 +20,6 @@ RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=10
END:STANDARD
END:VTIMEZONE
BEGIN:VTODO
-
+DTSTART;TZID=Europe/Paris:20130901T180000
END:VTODO
END:VCALENDAR
diff --git a/tests/static/todo4.ics b/tests/static/todo4.ics
index 8005238f..0b5835f2 100644
--- a/tests/static/todo4.ics
+++ b/tests/static/todo4.ics
@@ -20,6 +20,6 @@ RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=10
END:STANDARD
END:VTIMEZONE
BEGIN:VTODO
-
+DUE;TZID=Europe/Paris:20130903T180000
END:VTODO
END:VCALENDAR
diff --git a/tests/static/todo5.ics b/tests/static/todo5.ics
index 8005238f..ae6a629b 100644
--- a/tests/static/todo5.ics
+++ b/tests/static/todo5.ics
@@ -20,6 +20,7 @@ RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=10
END:STANDARD
END:VTIMEZONE
BEGIN:VTODO
-
+CREATED;TZID=Europe/Paris:20130903T180000
+COMPLETED;TZID=Europe/Paris:20130920T180000
END:VTODO
END:VCALENDAR
diff --git a/tests/static/todo6.ics b/tests/static/todo6.ics
new file mode 100644
index 00000000..db9b4b56
--- /dev/null
+++ b/tests/static/todo6.ics
@@ -0,0 +1,25 @@
+BEGIN:VCALENDAR
+PRODID:-//Mozilla.org/NONSGML Mozilla Calendar V1.1//EN
+VERSION:2.0
+BEGIN:VTIMEZONE
+TZID:Europe/Paris
+X-LIC-LOCATION:Europe/Paris
+BEGIN:DAYLIGHT
+TZOFFSETFROM:+0100
+TZOFFSETTO:+0200
+TZNAME:CEST
+DTSTART:19700329T020000
+RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=3
+END:DAYLIGHT
+BEGIN:STANDARD
+TZOFFSETFROM:+0200
+TZOFFSETTO:+0100
+TZNAME:CET
+DTSTART:19701025T030000
+RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=10
+END:STANDARD
+END:VTIMEZONE
+BEGIN:VTODO
+COMPLETED;TZID=Europe/Paris:20130920T180000
+END:VTODO
+END:VCALENDAR
diff --git a/tests/static/todo7.ics b/tests/static/todo7.ics
new file mode 100644
index 00000000..1d44c3a4
--- /dev/null
+++ b/tests/static/todo7.ics
@@ -0,0 +1,25 @@
+BEGIN:VCALENDAR
+PRODID:-//Mozilla.org/NONSGML Mozilla Calendar V1.1//EN
+VERSION:2.0
+BEGIN:VTIMEZONE
+TZID:Europe/Paris
+X-LIC-LOCATION:Europe/Paris
+BEGIN:DAYLIGHT
+TZOFFSETFROM:+0100
+TZOFFSETTO:+0200
+TZNAME:CEST
+DTSTART:19700329T020000
+RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=3
+END:DAYLIGHT
+BEGIN:STANDARD
+TZOFFSETFROM:+0200
+TZOFFSETTO:+0100
+TZNAME:CET
+DTSTART:19701025T030000
+RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=10
+END:STANDARD
+END:VTIMEZONE
+BEGIN:VTODO
+CREATED;TZID=Europe/Paris:20130803T180000
+END:VTODO
+END:VCALENDAR
diff --git a/tests/static/todo8.ics b/tests/static/todo8.ics
new file mode 100644
index 00000000..8005238f
--- /dev/null
+++ b/tests/static/todo8.ics
@@ -0,0 +1,25 @@
+BEGIN:VCALENDAR
+PRODID:-//Mozilla.org/NONSGML Mozilla Calendar V1.1//EN
+VERSION:2.0
+BEGIN:VTIMEZONE
+TZID:Europe/Paris
+X-LIC-LOCATION:Europe/Paris
+BEGIN:DAYLIGHT
+TZOFFSETFROM:+0100
+TZOFFSETTO:+0200
+TZNAME:CEST
+DTSTART:19700329T020000
+RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=3
+END:DAYLIGHT
+BEGIN:STANDARD
+TZOFFSETFROM:+0200
+TZOFFSETTO:+0100
+TZNAME:CET
+DTSTART:19701025T030000
+RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=10
+END:STANDARD
+END:VTIMEZONE
+BEGIN:VTODO
+
+END:VTODO
+END:VCALENDAR
diff --git a/tests/test_base.py b/tests/test_base.py
index c5add4b4..bd386327 100644
--- a/tests/test_base.py
+++ b/tests/test_base.py
@@ -371,16 +371,80 @@ class BaseRequests:
assert "href>/calendar.ics/event4.ics" not in answer
assert "href>/calendar.ics/event5.ics" not in answer
+ answer = self._test_filter(["""
+
+
+
+
+ """],"todo", events=8)
+ assert "href>/calendar.ics/todo1.ics" in answer
+ assert "href>/calendar.ics/todo2.ics" in answer
+ assert "href>/calendar.ics/todo3.ics" in answer
+ assert "href>/calendar.ics/todo4.ics" in answer
+ assert "href>/calendar.ics/todo5.ics" in answer
+ assert "href>/calendar.ics/todo6.ics" in answer
+ assert "href>/calendar.ics/todo7.ics" in answer
+ assert "href>/calendar.ics/todo8.ics" in answer
+
+ answer = self._test_filter(["""
+
+
+
+
+ """],"todo", events=8)
+ assert "href>/calendar.ics/todo1.ics" not in answer
+ assert "href>/calendar.ics/todo2.ics" not in answer
+ assert "href>/calendar.ics/todo3.ics" not in answer
+ assert "href>/calendar.ics/todo4.ics" not in answer
+ assert "href>/calendar.ics/todo5.ics" not in answer
+ assert "href>/calendar.ics/todo6.ics" not in answer
+ assert "href>/calendar.ics/todo7.ics" not in answer
+ assert "href>/calendar.ics/todo8.ics" in answer
+
answer = self._test_filter(["""
- """], "journal", events=1)
- assert "href>/calendar.ics/journal1.ics" in answer
- # assert "href>/calendar.ics/journal2.ics" not in answer
-
+ """], "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(["""
+
+
+
+
+ """], "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(["""
+
+
+
+
+ """], "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(["""
+
+
+
+
+ """], "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):
"""Base class for filesystem tests."""
storage_type = "multifilesystem"