summaryrefslogtreecommitdiffstats
path: root/tests/unit/test-011-itip.py
diff options
context:
space:
mode:
authorThomas Bruederli <bruederli@kolabsys.com>2014-08-05 00:22:22 -0400
committerThomas Bruederli <bruederli@kolabsys.com>2014-08-05 00:22:22 -0400
commit78b688519c8b73d66ab1f4fba74ab39acdf9552f (patch)
tree0ba7333b076098005b93b8901f6890af975f95ae /tests/unit/test-011-itip.py
parente636a436365e2025e50ed7eb16105f134412bd62 (diff)
downloadpykolab-78b688519c8b73d66ab1f4fba74ab39acdf9552f.tar.gz
Respect transparency property for conflict detection; fix tests for translated iTip message contents
Diffstat (limited to 'tests/unit/test-011-itip.py')
-rw-r--r--tests/unit/test-011-itip.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/tests/unit/test-011-itip.py b/tests/unit/test-011-itip.py
index a120fd2..a08d05f 100644
--- a/tests/unit/test-011-itip.py
+++ b/tests/unit/test-011-itip.py
@@ -5,6 +5,8 @@ import kolabformat
from pykolab import itip
from pykolab.xml import Event
+from pykolab.xml import participant_status_label
+from pykolab.translate import _
from icalendar import Calendar
from email import message
@@ -363,6 +365,9 @@ class TestITip(unittest.TestCase):
self.assertTrue(itip.check_event_conflict(allday, itip_event), "Conflicting allday event")
+ allday.set_transparency(True)
+ self.assertFalse(itip.check_event_conflict(allday, itip_event), "No conflict if event is set to transparent")
+
event2 = Event()
event2.set_start(datetime.datetime(2012,7,13, 10,0,0, tzinfo=pytz.timezone("US/Central")))
event2.set_end(datetime.datetime(2012,7,13, 11,0,0, tzinfo=pytz.timezone("US/Central")))
@@ -398,9 +403,10 @@ class TestITip(unittest.TestCase):
self.assertEqual(self.smtplog[0][0], 'resource-collection-car@example.org', "From attendee")
self.assertEqual(self.smtplog[0][1], 'john.doe@example.org', "To organizer")
+ _accepted = participant_status_label('ACCEPTED')
message = message_from_string(self.smtplog[0][2])
- self.assertEqual(message.get('Subject'), 'Invitation for test was ACCEPTED')
+ self.assertEqual(message.get('Subject'), _("Invitation for %(summary)s was %(status)s") % { 'summary':'test', 'status':_accepted })
text = str(message.get_payload(0));
self.assertIn('SUMMARY=test', text)
- self.assertIn('STATUS=ACCEPTED', text)
+ self.assertIn('STATUS=' + _accepted, text)