Exemple #1
0
 def test_clone_groups(self):
     groups = IGroups(self.portal)
     _old, _new = ("rename_old", "rename_new")
     groups.add(_old)
     assert _old in groups
     g_old = groups.get(_old)
     g_old.assign(self.user1)
     assert self.user1 in g_old
     clone = groups.clone(_old, _new)  # noqa
     assert _old in groups
     assert _new in groups
     assert self.user1 in groups.get(_new)
Exemple #2
0
 def setUp(self):
     self.portal = self.layer["portal"]
     self.wftool = getToolByName(self.portal, "portal_workflow")
     setRoles(self.portal, TEST_USER_ID, ["Manager"])
     self._users = self.portal.acl_users
     self.groups_plugin = self._users.source_groups
     self.site_members = SiteMembers(self.portal)
     self.user1 = "*****@*****.**"
     self.user2 = "*****@*****.**"
     self.group1 = "adapter_group1"
     self.group2 = "adapter_gropu2"
     self.site_members.register(self.user1, send=False)
     self.site_members.register(self.user2, send=False)
     groups = IGroups(self.portal)
     groups.add(self.group1)
     groups.add(self.group2)
Exemple #3
0
 def test_add_rename_remove_group(self):
     groups = IGroups(self.portal)
     _old, _new = ("rename_old", "rename_new")
     groups.add(_old)
     assert _old in groups
     g_old = groups.get(_old)
     g_old.assign(self.user1)
     assert self.user1 in g_old
     groups.rename(_old, _new)
     assert _old not in groups
     assert _new in groups
     assert self.user1 in groups.get(_new)
     groups.get(_new).unassign(self.user1)  # tear-down
     assert self.user1 not in groups.get(_new)
     groups.remove(_new)
     assert _old not in groups
     assert _new not in groups