summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pykolab/xml/event.py3
-rw-r--r--tests/unit/test-003-event.py12
2 files changed, 13 insertions, 2 deletions
diff --git a/pykolab/xml/event.py b/pykolab/xml/event.py
index 482b1bc..4f3ca0a 100644
--- a/pykolab/xml/event.py
+++ b/pykolab/xml/event.py
@@ -404,9 +404,8 @@ class Event(object):
return self.get_end()
def get_ical_dtstamp(self):
- return
try:
- retval = self.event.lastModified()
+ retval = self.get_lastmodified()
if retval == None or retval == "":
return datetime.datetime.now()
except:
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()