[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/Security/tests - testAttributeRolePermissionManager.py:1.1.2.2
Jim Fulton
jim@zope.com
Thu, 3 Jan 2002 14:15:23 -0500
Update of /cvs-repository/Zope3/lib/python/Zope/App/Security/tests
In directory cvs.zope.org:/tmp/cvs-serv14309
Modified Files:
Tag: Zope-3x-branch
testAttributeRolePermissionManager.py
Log Message:
Added code for testing duplicates and retracting.
=== Zope3/lib/python/Zope/App/Security/tests/testAttributeRolePermissionManager.py 1.1.2.1 => 1.1.2.2 ===
mgr.grantPermissionToRole('read','manager')
mgr.grantPermissionToRole('write','manager')
+ mgr.grantPermissionToRole('write','manager')
mgr.grantPermissionToRole('read','peon')
@@ -65,6 +66,14 @@
l = list(mgr.getRolesForPermission('write'))
self.assertEqual(l, [ 'manager' ] )
+
+ mgr.retractPermissionFromRole('read', 'peon')
+ l = list(mgr.getPermissionsForRole('peon'))
+ self.assertEqual(l, [] )
+
+ l = list(mgr.getRolesForPermission('read'))
+ self.assertEqual(l, [ 'manager' ] )
+
def testInvalid(self):
obj = Manageable()