From a5d5cc8b2ce337456d5e794ee5b7be71cfe42c1b Mon Sep 17 00:00:00 2001 From: Cedric Boscher Date: Wed, 15 Jun 2016 15:45:27 +0200 Subject: [PATCH] debug VTODO and first tests running --- radicale/xmlutils.py | 3 ++- tests/static/todo1.ics | 3 ++- tests/static/todo2.ics | 3 ++- tests/static/todo3.ics | 2 +- tests/static/todo4.ics | 2 +- tests/static/todo5.ics | 3 ++- tests/static/todo6.ics | 25 +++++++++++++++++++++++++ tests/static/todo7.ics | 25 +++++++++++++++++++++++++ tests/static/todo8.ics | 25 +++++++++++++++++++++++++ tests/test_base.py | 32 +++++++++++++++++++++++++++++++- 10 files changed, 116 insertions(+), 7 deletions(-) create mode 100644 tests/static/todo6.ics create mode 100644 tests/static/todo7.ics create mode 100644 tests/static/todo8.ics diff --git a/radicale/xmlutils.py b/radicale/xmlutils.py index 5335481..c4c4f3e 100644 --- a/radicale/xmlutils.py +++ b/radicale/xmlutils.py @@ -304,8 +304,9 @@ 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 diff --git a/tests/static/todo1.ics b/tests/static/todo1.ics index 8005238..991fcd7 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 8005238..e4b3bad 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 8005238..fb29bc1 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 8005238..0b5835f 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 8005238..ae6a629 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 0000000..db9b4b5 --- /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 0000000..1d44c3a --- /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 0000000..8005238 --- /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 df7eee2..458746a 100644 --- a/tests/test_base.py +++ b/tests/test_base.py @@ -370,7 +370,37 @@ class BaseRequests: assert "href>/calendar.ics/event3.ics/calendar.ics/event4.ics/calendar.ics/event5.ics + + + + """],"todo", events=8) + assert "href>/calendar.ics/todo1.ics/calendar.ics/todo2.ics/calendar.ics/todo3.ics/calendar.ics/todo4.ics/calendar.ics/todo5.ics/calendar.ics/todo6.ics/calendar.ics/todo7.ics/calendar.ics/todo8.ics + + + + """],"todo", events=8) + assert "href>/calendar.ics/todo1.ics/calendar.ics/todo2.ics/calendar.ics/todo3.ics/calendar.ics/todo4.ics/calendar.ics/todo5.ics/calendar.ics/todo6.ics/calendar.ics/todo7.ics/calendar.ics/todo8.ics