[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/Security/tests - testPrincipalPermissionManager.py:1.1.2.2
Jim Fulton
jim@zope.com
Thu, 13 Dec 2001 17:41:46 -0500
Update of /cvs-repository/Zope3/lib/python/Zope/App/Security/tests
In directory cvs.zope.org:/tmp/cvs-serv25345/tests
Modified Files:
Tag: Zope-3x-branch
testPrincipalPermissionManager.py
Log Message:
changed definePermission signature to match tutorial and require a title
=== Zope3/lib/python/Zope/App/Security/tests/testPrincipalPermissionManager.py 1.1.2.1 => 1.1.2.2 ===
def testUnboundPrincipalPermission(self):
- permission = pregistry.definePermission('APerm')
+ permission = pregistry.definePermission('APerm', 'title')
principal = self._make_principal()
self.assertEqual(manager.getPrincipalsForPermission(permission), [])
self.assertEqual(manager.getPermissionsForPrincipal(principal), [])
def testPrincipalPermission(self):
- permission = pregistry.definePermission('APerm')
+ permission = pregistry.definePermission('APerm', 'title')
principal = self._make_principal()
manager.grantPermissionToPrincipal(permission, principal)
self.assertEqual(manager.getPrincipalsForPermission(permission),
@@ -45,8 +45,8 @@
[permission])
def testManyPermissionsOnePrincipal(self):
- perm1 = pregistry.definePermission('Perm One')
- perm2 = pregistry.definePermission('Perm Two')
+ perm1 = pregistry.definePermission('Perm One', 'title')
+ perm2 = pregistry.definePermission('Perm Two', 'title')
prin1 = self._make_principal()
manager.grantPermissionToPrincipal(perm1, prin1)
manager.grantPermissionToPrincipal(perm2, prin1)
@@ -56,7 +56,7 @@
self.failUnless(perm2 in perms)
def testManyPrincipalsOnePermission(self):
- perm1 = pregistry.definePermission('Perm One')
+ perm1 = pregistry.definePermission('Perm One', 'title')
prin1 = self._make_principal()
prin2 = self._make_principal('Principal 2', 'Principal Two')
manager.grantPermissionToPrincipal(perm1, prin1)