summaryrefslogtreecommitdiffstats
path: root/tests/unit
diff options
context:
space:
mode:
authorThomas Bruederli <bruederli@kolabsys.com>2014-12-23 06:36:46 +0100
committerThomas Bruederli <bruederli@kolabsys.com>2014-12-23 06:38:28 +0100
commit856a2aa11f6d1d661eacbf9e4f34c92d23a2f4ce (patch)
tree59490a4ef0878b079d0120a5f0bf0d9250162a2c /tests/unit
parent7c459583bc4963f0de36cb85b2fccc5e33fdedfb (diff)
downloadpykolab-856a2aa11f6d1d661eacbf9e4f34c92d23a2f4ce.tar.gz
Fix event.get_next_occurence() computation with infinitely recurring all-day events (#4079)
Diffstat (limited to 'tests/unit')
-rw-r--r--tests/unit/test-003-event.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/unit/test-003-event.py b/tests/unit/test-003-event.py
index 7fae6eb..02bc8df 100644
--- a/tests/unit/test-003-event.py
+++ b/tests/unit/test-003-event.py
@@ -533,6 +533,18 @@ END:VEVENT
self.assertEqual(next_instance.get_start().month, 7)
self.assertFalse(next_instance.is_recurring())
+ # check get_next_occurence() with an infinitely recurring all-day event
+ rrule = kolabformat.RecurrenceRule()
+ rrule.setFrequency(kolabformat.RecurrenceRule.Yearly)
+ self.event.set_recurrence(rrule);
+
+ self.event.set_start(datetime.date(2014, 5, 1))
+ self.event.set_end(datetime.date(2014, 5, 1))
+ next_date = self.event.get_next_occurence(datetime.date(2015, 1, 1))
+ self.assertIsInstance(next_date, datetime.date)
+ self.assertEqual(next_date.year, 2015)
+ self.assertEqual(next_date.month, 5)
+
def test_021_calendaring_no_recurrence(self):
_start = datetime.datetime(2014, 2, 1, 14, 30, 00, tzinfo=pytz.timezone("Europe/London"))
self.event = Event()