Skip to content

Commit ef8f140

Browse files
committed
test for issue 397
1 parent eb3d21c commit ef8f140

1 file changed

Lines changed: 36 additions & 1 deletion

File tree

tests/test_caldav.py

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -844,6 +844,41 @@ def testSchedulingMailboxes(self):
844844
inbox = self.principal.schedule_inbox()
845845
outbox = self.principal.schedule_outbox()
846846

847+
def testIssue397(self):
848+
cal = self._fixCalendar()
849+
cal.save_event("""
850+
BEGIN:VCALENDAR
851+
VERSION:2.0
852+
BEGIN:VEVENT
853+
SUMMARY:recurrence with attendee one single item
854+
DTSTART;TZID=Europe/Zurich:20240101T090000
855+
DTEND;TZID=Europe/Zurich:20240101T180000
856+
UID:test1
857+
DESCRIPTION:this is the recurrent series
858+
TRANSP:OPAQUE
859+
RRULE:FREQ=WEEKLY;BYDAY=TU,WE,TH
860+
END:VEVENT
861+
BEGIN:VEVENT
862+
SUMMARY:single item
863+
DTSTART;TZID=Europe/Zurich:20240605T090000
864+
DTEND;TZID=Europe/Zurich:20240605T170000
865+
UID:test1
866+
DESCRIPTION:this is the single item assigning a attendee to just one event
867+
ATTENDEE:foo.bar@corge.baz
868+
RECURRENCE-ID:20240605T070000Z
869+
END:VEVENT
870+
END:VCALENDAR
871+
""")
872+
873+
object_by_id = cal.object_by_uid('test1',comp_class=Event)
874+
instance = object_by_id.icalendar_instance
875+
events = [event for event in instance.subcomponents if isinstance(event,icalendar.Event)]
876+
assert len(events) == 2
877+
object_by_id = cal.object_by_uid('test1',comp_class=None)
878+
instance = object_by_id.icalendar_instance
879+
events = [event for event in instance.subcomponents if isinstance(event,icalendar.Event)]
880+
assert len(events) == 2
881+
847882
def testPropfind(self):
848883
"""
849884
Test of the propfind methods. (This is sort of redundant, since
@@ -3056,7 +3091,7 @@ def search(month):
30563091
event=True,
30573092
start=datetime(2015, month, 1),
30583093
end=datetime(2015, month, 2),
3059-
expand="client", ## client will be default from 2.0
3094+
expand=True,
30603095
)
30613096
assert len(recurrence) == 1
30623097
return recurrence[0]

0 commit comments

Comments
 (0)