summaryrefslogtreecommitdiffstats
path: root/tests/unit/test-003-event.py
diff options
context:
space:
mode:
authorChristian Mollekopf <mollekopf@apheleia-it.ch>2022-08-15 16:17:27 +0200
committerChristian Mollekopf <mollekopf@apheleia-it.ch>2022-08-25 16:12:05 +0200
commit7dd538e9d198afa450024324f3bcad507de2e388 (patch)
tree1d9dc4f4f44ac7a6be8cc6f41a5b6b814ce9e241 /tests/unit/test-003-event.py
parent6109a15d25a071eebeb9a33f26776671675befdf (diff)
downloadpykolab-7dd538e9d198afa450024324f3bcad507de2e388.tar.gz
Restore python2 compat
Diffstat (limited to 'tests/unit/test-003-event.py')
-rw-r--r--tests/unit/test-003-event.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/tests/unit/test-003-event.py b/tests/unit/test-003-event.py
index f048d2e..24785f7 100644
--- a/tests/unit/test-003-event.py
+++ b/tests/unit/test-003-event.py
@@ -569,11 +569,8 @@ class TestEventXML(unittest.TestCase):
self.event.set_recurrence(rrule)
ical = icalendar.Calendar.from_ical(self.event.as_string_itip())
- print(self.event.as_string_itip())
event = ical.walk('VEVENT')[0]
- # self.assertEqual(bytes(event['uid'], "utf-8"), self.event.get_uid())
- print(event['uid'])
self.assertEqual(event['uid'], self.event.get_uid())
self.assertEqual(event['summary'], "test")
self.assertEqual(event['sequence'], 3)
@@ -763,7 +760,7 @@ class TestEventXML(unittest.TestCase):
# event = vevents[0]
# exception = vevents[1]
- # self.assertEqual(bytes(event['uid'], "utf-8"), self.event.get_uid())
+ # self.assertEqual(bytes(event['uid'].encode("utf-8")), self.event.get_uid())
# self.assertEqual(event['summary'], "test")
# self.assertEqual(exception['uid'], self.event.get_uid())
@@ -1024,7 +1021,11 @@ ORGANIZER:MAILTO:tests@test.com
END:VEVENT
"""
event = event_from_ical(ical)
- self.assertEqual(str(event.get_lastmodified()), "1970-01-01")
+
+ if sys.version_info.major >= 3:
+ self.assertEqual(str(event.get_lastmodified()), "1970-01-01")
+ else:
+ self.assertEqual(str(event.get_lastmodified()), "1970-01-01 00:00:00+00:00")
def _find_prop_in_list(self, diff, name):