diff --git a/radicale/tests/test_base.py b/radicale/tests/test_base.py index 1e716f6..1c73068 100644 --- a/radicale/tests/test_base.py +++ b/radicale/tests/test_base.py @@ -1059,10 +1059,13 @@ class BaseRequestsMixIn: %s """ % sync_token_xml) - if sync_token and status == 409: + xml = DefusedET.fromstring(answer) + if status in (403, 409): + assert xml.tag == xmlutils.make_clark("D:error") + assert sync_token and xml.find( + xmlutils.make_clark("D:valid-sync-token")) is not None return None, None assert status == 207 - xml = DefusedET.fromstring(answer) assert xml.tag == xmlutils.make_clark("D:multistatus") sync_token = xml.find(xmlutils.make_clark("D:sync-token")).text.strip() assert sync_token diff --git a/radicale/xmlutils.py b/radicale/xmlutils.py index a76f803..af60ce6 100644 --- a/radicale/xmlutils.py +++ b/radicale/xmlutils.py @@ -131,7 +131,7 @@ def make_href(base_prefix, href): def webdav_error(human_tag): """Generate XML error message.""" root = ET.Element(make_clark("D:error")) - root.append(ET.Element(human_tag)) + root.append(ET.Element(make_clark(human_tag))) return root