From 8c3db5389284295fa5253b9f683a7ea596d6ed3e Mon Sep 17 00:00:00 2001 From: Peter Bieringer Date: Thu, 9 Apr 2026 21:30:48 +0200 Subject: [PATCH] sharing/tests: add additional propfind checks --- radicale/tests/test_sharing.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/radicale/tests/test_sharing.py b/radicale/tests/test_sharing.py index c140ad10..e47c9b0e 100644 --- a/radicale/tests/test_sharing.py +++ b/radicale/tests/test_sharing.py @@ -5199,6 +5199,15 @@ permissions: RrWw""") assert "D:sync-token" not in response assert "C:supported-calendar-component-set" in response assert "D:current-user-privilege-set" in response + status, props = response["D:current-user-privilege-set"] + privileges = props.findall(xmlutils.make_clark("D:privilege")) + assert len(privileges) >= 1 + privileges_list = [xmlutils.make_human_tag(privilege.findall("*")[0].tag) for privilege in privileges] + assert "D:read" in privileges_list + assert "D:write-content" not in privileges_list + assert "D:write-properties" not in privileges_list + assert "D:write" not in privileges_list + assert "D:all" not in privileges_list # execute PROPPATCH color as user logging.info("\n*** PROPPATCH color collection with token -> permission denied") @@ -5222,6 +5231,19 @@ permissions: RrWw""") json_dict['Conversion'] = "bday" _, headers, answer = self._sharing_api_json("token", "update", check=200, login="owner:ownerpw", json_dict=json_dict) + logging.info("\n*** PROPFIND item with token -> calendar") + response = self._propfind_allprop(path_shared) + logging.debug("response: %r", response) + status, props = response["D:current-user-privilege-set"] + privileges = props.findall(xmlutils.make_clark("D:privilege")) + assert len(privileges) >= 1 + privileges_list = [xmlutils.make_human_tag(privilege.findall("*")[0].tag) for privilege in privileges] + assert "D:read" in privileges_list + assert "D:write-content" not in privileges_list + assert "D:write-properties" in privileges_list + assert "D:write" not in privileges_list + assert "D:all" not in privileges_list + # execute PROPPATCH color as user logging.info("\n*** PROPPATCH color collection with token -> ok") color = "#BBBBBB"