Skip to content

Commit

Permalink
Workaround for tests breaking with xandikos.
Browse files Browse the repository at this point in the history
See #395
  • Loading branch information
tobixen committed Oct 26, 2024
1 parent 4fa67d2 commit c3cefe9
Showing 1 changed file with 22 additions and 11 deletions.
33 changes: 22 additions & 11 deletions tests/test_caldav.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,8 @@
PRODID:-//Mozilla.org/NONSGML Mozilla Calendar V1.1//EN
BEGIN:VEVENT
UID:c26921f4-0653-11ef-b756-58ce2a14e2e5
DTSTART;VALUE=DATE:20240411
DTEND;VALUE=DATE:20240412
DTSTART:20240411T123000Z
DTEND:20240412T123000Z
DTSTAMP:20240429T181103Z
LAST-MODIFIED:20240429T181103Z
RRULE:FREQ=WEEKLY;INTERVAL=2
Expand All @@ -192,9 +192,9 @@
END:VEVENT
BEGIN:VEVENT
UID:c26921f4-0653-11ef-b756-58ce2a14e2e5
RECURRENCE-ID;VALUE=DATE:20240425
DTSTART;VALUE=DATE:20240425
DTEND;VALUE=DATE:20240426
RECURRENCE-ID:20240425T123000Z
DTSTART:20240425T123000Z
DTEND:20240426T123000Z
CREATED:20240429T181031Z
DTSTAMP:20240429T181103Z
LAST-MODIFIED:20240429T181103Z
Expand Down Expand Up @@ -2628,14 +2628,25 @@ def testRecurringDateWithExceptionSearch(self):

assert len(r) == 2

assert 'RRULE' not in r[0].data
assert 'RRULE' not in r[1].data
assert "RRULE" not in r[0].data
assert "RRULE" not in r[1].data

assert isinstance(r[0].icalendar_component['RECURRENCE-ID'], icalendar.vDDDTypes)
assert r[0].icalendar_component['RECURRENCE-ID'].dt == date(2024, 4, 11)
assert isinstance(
r[0].icalendar_component["RECURRENCE-ID"], icalendar.vDDDTypes
)

## TODO: xandikos returns a datetime without a tzinfo, radicale returns a datetime with tzinfo=UTC, but perhaps other calendar servers returns the timestamp converted to localtime?

assert isinstance(r[1].icalendar_component['RECURRENCE-ID'], icalendar.vDDDTypes)
assert r[1].icalendar_component['RECURRENCE-ID'].dt == date(2024, 4, 25)
assert r[0].icalendar_component["RECURRENCE-ID"].dt.replace(
tzinfo=None
) == datetime(2024, 4, 11, 12, 30, 00)

assert isinstance(
r[1].icalendar_component["RECURRENCE-ID"], icalendar.vDDDTypes
)
assert r[1].icalendar_component["RECURRENCE-ID"].dt.replace(
tzinfo=None
) == datetime(2024, 4, 25, 12, 30, 00)

def testOffsetURL(self):
"""
Expand Down

0 comments on commit c3cefe9

Please sign in to comment.