diff --git a/ChangeLog b/ChangeLog index fc0c75823..187cbc1c5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2010-09-20 Wolfgang Sourdeau + + * Tests/Integration/test-davacl.py + (DAVCalendarPublicAclTest.testCollectionAccessNormalUser): make + use of the fix below when removing the rights for the subscriber + user. + + * Tests/Integration/utilities.py (TestACLUtility.setupRights): + when "rights" is None or unspecified, the user is now deleted from + the access list. This enable default roles to take place for the + specified user, which is different from simply removing all its + rights. + 2010-09-17 Wolfgang Sourdeau * Main/SOGo+DAV.m (-davComplianceClassesInContext:): new method to diff --git a/Tests/Integration/test-davacl.py b/Tests/Integration/test-davacl.py index 87e47a7d3..a93d7b8d0 100755 --- a/Tests/Integration/test-davacl.py +++ b/Tests/Integration/test-davacl.py @@ -1014,7 +1014,7 @@ class DAVCalendarPublicAclTest(unittest.TestCase): "href was returned more than once: %s" % href.text) resourceHrefs[href.text] = True - acl_utility.setupRights(subscriber_username, {}) + acl_utility.setupRights(subscriber_username) # 3. creation right added for "default user" # subscriber_username expected to have access, but not "anonymous" diff --git a/Tests/Integration/utilities.py b/Tests/Integration/utilities.py index 352ad342d..20f70ad18 100644 --- a/Tests/Integration/utilities.py +++ b/Tests/Integration/utilities.py @@ -64,22 +64,34 @@ class TestACLUtility(TestUtility): def rightsToSOGoRights(self, rights): self.fail("subclass must implement this method") - def setupRights(self, username, rights): - rights_str = "".join(["<%s/>" - % x for x in self.rightsToSOGoRights(rights) ]) - aclQuery = ("\n" - + "" - + "%s" % (xml.sax.saxutils.escape(username), - rights_str) - + "") + def setupRights(self, username, rights = None): + if rights is not None: + rights_str = "".join(["<%s/>" + % x for x in self.rightsToSOGoRights(rights) ]) + aclQuery = ("\n" + + "" + + "%s" % (xml.sax.saxutils.escape(username), + rights_str) + + "") + else: + aclQuery = ("\n" + + "" + + "" % xml.sax.saxutils.escape(username) + + "") post = webdavlib.HTTPPOST(self.resource, aclQuery) post.content_type = "application/xml; charset=\"utf-8\"" self.client.execute(post) - self.test.assertEquals(post.response["status"], 204, - "rights modification: failure to set '%s' (status: %d)" - % (rights_str, post.response["status"])) + + if rights is None: + err_msg = ("rights modification: failure to remove entry (status: %d)" + % post.response["status"]) + else: + err_msg = ("rights modification: failure to set '%s' (status: %d)" + % (rights_str, post.response["status"])) + self.test.assertEquals(post.response["status"], 204, err_msg) # Calendar: # rights: