summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pykolab/xml/event.py4
-rw-r--r--tests/unit/test-003-event.py8
2 files changed, 9 insertions, 3 deletions
diff --git a/pykolab/xml/event.py b/pykolab/xml/event.py
index 6655b8c..c199a5a 100644
--- a/pykolab/xml/event.py
+++ b/pykolab/xml/event.py
@@ -117,7 +117,9 @@ class Event(object):
def _load_attendees(self):
for a in self.event.attendees():
- self._attendees.append(Attendee(a.contact().email(), a.contact().name(), a.rsvp(), a.role(), a.partStat(), a.cutype()))
+ att = Attendee(a.contact().email())
+ att.copy_from(a)
+ self._attendees.append(att)
def add_attendee(self, email, name=None, rsvp=False, role=None, participant_status=None, cutype="INDIVIDUAL", params=None):
attendee = Attendee(email, name, rsvp, role, participant_status, cutype, params)
diff --git a/tests/unit/test-003-event.py b/tests/unit/test-003-event.py
index fa5d0fe..d9e05fa 100644
--- a/tests/unit/test-003-event.py
+++ b/tests/unit/test-003-event.py
@@ -160,13 +160,15 @@ xml_event = """
<partstat><text>ACCEPTED</text></partstat>
<role><text>REQ-PARTICIPANT</text></role>
<rsvp><boolean>true</boolean></rsvp>
+ <delegated-from><cal-address>mailto:%3Csomebody%40else.com%3E</cal-address></delegated-from>
</parameters>
<cal-address>mailto:%3Cjane%40example.org%3E</cal-address>
</attendee>
<attendee>
<parameters>
- <partstat><text>TENTATIVE</text></partstat>
- <role><text>OPT-PARTICIPANT</text></role>
+ <partstat><text>DELEGATED</text></partstat>
+ <role><text>NON-PARTICIPANT</text></role>
+ <delegated-to><cal-address>mailto:%3Cjane%40example.org%3E</cal-address></delegated-to>
</parameters>
<cal-address>mailto:%3Csomebody%40else.com%3E</cal-address>
</attendee>
@@ -527,6 +529,8 @@ END:VEVENT
event = event_from_string(xml_event)
self.assertEqual(event.uid, '75c740bb-b3c6-442c-8021-ecbaeb0a025e')
self.assertEqual(event.get_attendee_by_email("jane@example.org").get_participant_status(), kolabformat.PartAccepted)
+ self.assertEqual(len(event.get_attendee_by_email("jane@example.org").get_delegated_from()), 1)
+ self.assertEqual(len(event.get_attendee_by_email("somebody@else.com").get_delegated_to()), 1)
self.assertEqual(event.get_sequence(), 1)
self.assertIsInstance(event.get_start(), datetime.datetime)
self.assertEqual(str(event.get_start()), "2014-08-13 10:00:00+00:00")