[Zope3-checkins] CVS: Zope3/lib/python/Zope/App/Security/tests - testPermissionField.py:1.2
Steve Alexander
steve@cat-box.net
Sat, 21 Dec 2002 15:17:57 -0500
Update of /cvs-repository/Zope3/lib/python/Zope/App/Security/tests
In directory cvs.zope.org:/tmp/cvs-serv12140/lib/python/Zope/App/Security/tests
Modified Files:
testPermissionField.py
Log Message:
fixed bug in test.
=== Zope3/lib/python/Zope/App/Security/tests/testPermissionField.py 1.1 => 1.2 ===
--- Zope3/lib/python/Zope/App/Security/tests/testPermissionField.py:1.1 Sat Dec 21 14:56:36 2002
+++ Zope3/lib/python/Zope/App/Security/tests/testPermissionField.py Sat Dec 21 15:17:56 2002
@@ -24,17 +24,18 @@
from Zope.App.Security.IPermissionService import IPermissionService
from Zope.ComponentArchitecture.GlobalServiceManager \
import serviceManager, defineService
+from Zope.App.Security.Registries.PermissionRegistry import Permission
class TestPermissionField(PlacelessSetup, TestCase):
def test_validate(self):
defineService("Permissions", IPermissionService)
serviceManager.provideService("Permissions", permissionRegistry)
-
+ dummy = Permission('dummy', 'Dummy', 'Dummy permission')
field = PermissionField()
- self.assertRaises(ValidationError, field.validate, 'read')
+ self.assertRaises(ValidationError, field.validate, dummy)
permissionRegistry.definePermission('read', 'Read', 'Read something')
- field.validate('read')
+ field.validate(permissionRegistry.getPermission('read'))
def test_suite():
return TestSuite((makeSuite(TestPermissionField),))