Skip to content

Commit ce61043

Browse files
committed
tests passes for zimbra now
1 parent e7d48aa commit ce61043

3 files changed

Lines changed: 17 additions & 9 deletions

File tree

caldav/davclient.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ def raw(self) -> str:
150150
## TODO: this should not really be needed?
151151
if not hasattr(self, "_raw"):
152152
self._raw = etree.tostring(cast(_Element, self.tree), pretty_print=True)
153-
return self._raw.decode()
153+
return to_normal_str(self._raw)
154154

155155
def _strip_to_multistatus(self):
156156
"""

tests/compatibility_issues.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,8 +248,10 @@
248248
"""Robur expands a yearly event into a monthly event. I believe I've reported this one upstream at some point, but can't find back to it""",
249249

250250
'no_search':
251-
"""Apparently the calendar server does not support search at all (this often implies that 'object_by_uid_is_broken' has to be set as well)"""
251+
"""Apparently the calendar server does not support search at all (this often implies that 'object_by_uid_is_broken' has to be set as well)""",
252252

253+
'no_events_and_tasks_on_same_calendar':
254+
"""Zimbra has the concept of task lists ... a calendar must either be a calendar with only events, or it can be a task list, but those must never be mixed"""
253255
}
254256

255257
xandikos = [
@@ -341,6 +343,8 @@
341343
'text_search_is_exact_match_only',
342344
'no_relships',
343345
'isnotdefined_not_working',
346+
"no_alarmsearch",
347+
"no_events_and_tasks_on_same_calendar",
344348

345349
## extra features not specified in RFC5545
346350
"calendar_order",

tests/test_caldav.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2541,10 +2541,14 @@ def testCreateOverwriteDeleteEvent(self):
25412541

25422542
# add event
25432543
e1 = c.save_event(ev1)
2544-
if not self.check_compatibility_flag("no_todo"):
2544+
2545+
todo_ok = not self.check_compatibility_flag(
2546+
"no_todo"
2547+
) and not self.check_compatibility_flag("no_events_and_tasks_on_same_calendar")
2548+
if todo_ok:
25452549
t1 = c.save_todo(todo)
25462550
assert e1.url is not None
2547-
if not self.check_compatibility_flag("no_todo"):
2551+
if todo_ok:
25482552
assert t1.url is not None
25492553
if not self.check_compatibility_flag("event_by_url_is_broken"):
25502554
assert c.event_by_url(e1.url).url == e1.url
@@ -2558,19 +2562,19 @@ def testCreateOverwriteDeleteEvent(self):
25582562
## (but some calendars may throw a "409 Conflict")
25592563
if not self.check_compatibility_flag("no_overwrite"):
25602564
e2 = c.save_event(ev1)
2561-
if not self.check_compatibility_flag("no_todo"):
2565+
if todo_ok:
25622566
t2 = c.save_todo(todo)
25632567

25642568
## add same event with "no_create". Should work like a charm.
25652569
e2 = c.save_event(ev1, no_create=no_create)
2566-
if not self.check_compatibility_flag("no_todo"):
2570+
if todo_ok:
25672571
t2 = c.save_todo(todo, no_create=no_create)
25682572

25692573
## this should also work.
25702574
e2.instance.vevent.summary.value = e2.instance.vevent.summary.value + "!"
25712575
e2.save(no_create=no_create)
25722576

2573-
if not self.check_compatibility_flag("no_todo"):
2577+
if todo_ok:
25742578
t2.instance.vtodo.summary.value = t2.instance.vtodo.summary.value + "!"
25752579
t2.save(no_create=no_create)
25762580

@@ -2582,13 +2586,13 @@ def testCreateOverwriteDeleteEvent(self):
25822586
if not self.check_compatibility_flag("object_by_uid_is_broken"):
25832587
with pytest.raises(error.ConsistencyError):
25842588
c.save_event(ev1, no_overwrite=True)
2585-
if not self.check_compatibility_flag("no_todo"):
2589+
if todo_ok:
25862590
with pytest.raises(error.ConsistencyError):
25872591
c.save_todo(todo, no_overwrite=True)
25882592

25892593
# delete event
25902594
e1.delete()
2591-
if not self.check_compatibility_flag("no_todo"):
2595+
if todo_ok:
25922596
t1.delete()
25932597

25942598
if self.check_compatibility_flag("non_existing_raises_other"):

0 commit comments

Comments
 (0)