summaryrefslogtreecommitdiffstats
path: root/tests/unit/test-003-event.py
diff options
context:
space:
mode:
authorThomas Bruederli <bruederli@kolabsys.com>2014-02-20 05:59:00 -0500
committerThomas Bruederli <bruederli@kolabsys.com>2014-02-20 05:59:00 -0500
commit4d460abbc06e0cc54f0a0b285708102829b618cc (patch)
tree742631bc53538631e2f1300c3b61aec2404810a5 /tests/unit/test-003-event.py
parentcffe8974b83342773fd28b5ce14540e34a88cf64 (diff)
downloadpykolab-4d460abbc06e0cc54f0a0b285708102829b618cc.tar.gz
Make sure the iCal version of an event has a valid dtstamp property
Diffstat (limited to 'tests/unit/test-003-event.py')
-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 59f131d..b90333a 100644
--- a/tests/unit/test-003-event.py
+++ b/tests/unit/test-003-event.py
@@ -135,5 +135,17 @@ END:VCALENDAR
self.assertEqual(event.get_attendee_by_email("max@imum.com").get_cutype(), kolabformat.CutypeResource)
self.assertEqual(event.get_sequence(), 2)
+ def test_019_as_string_itip(self):
+ self.event.set_summary("test")
+ self.event.set_start(datetime.datetime(2014, 05, 23, 11, 00, 00, tzinfo=pytz.timezone("Europe/London")))
+ self.event.set_end(datetime.datetime(2014, 05, 23, 12, 30, 00, tzinfo=pytz.timezone("Europe/London")))
+
+ ical = icalendar.Calendar.from_ical(self.event.as_string_itip())
+ event = ical.walk('VEVENT')[0]
+
+ self.assertEqual(event['uid'], self.event.get_uid())
+ self.assertEqual(event['summary'], "test")
+ self.assertIsInstance(event['dtstamp'].dt, datetime.datetime)
+
if __name__ == '__main__':
unittest.main()