[Zope3-checkins] CVS: Zope3/src/zope/app/security/tests -
test_zopepolicy.py:1.16
Jim Fulton
cvs-admin at zope.org
Fri Nov 21 12:12:43 EST 2003
Update of /cvs-repository/Zope3/src/zope/app/security/tests
In directory cvs.zope.org:/tmp/cvs-serv31883/src/zope/app/security/tests
Modified Files:
test_zopepolicy.py
Log Message:
Changed to use the new ztapi module, which provides handy functions
for setting up adapters and views for tests. This is needed because
there are no-longer global adapter and view services sitting around as
module globals.
=== Zope3/src/zope/app/security/tests/test_zopepolicy.py 1.15 => 1.16 ===
--- Zope3/src/zope/app/security/tests/test_zopepolicy.py:1.15 Mon Oct 6 15:29:49 2003
+++ Zope3/src/zope/app/security/tests/test_zopepolicy.py Fri Nov 21 12:12:12 2003
@@ -19,6 +19,7 @@
import unittest
+from zope.app.tests import ztapi
from zope.component.service import serviceManager as services
from zope.interface import implements
@@ -80,9 +81,9 @@
- getService(None,Adapters).provideAdapter(
- IAttributeAnnotatable, IAnnotations,
- AttributeAnnotations)
+ ztapi.provideAdapter(
+ IAttributeAnnotatable, IAnnotations,
+ AttributeAnnotations)
# set up some principals
self.jim = principalRegistry.definePrincipal('jim', 'Jim', 'Jim Fulton',
@@ -199,7 +200,7 @@
self.write, None, Context(self.jim)))
def testPlayfulPrincipalRole(self):
- getService(None,Adapters).provideAdapter(
+ ztapi.provideAdapter(
ITest,
IPrincipalRoleManager, AnnotationPrincipalRoleManager)
@@ -221,7 +222,7 @@
def testPlayfulRolePermissions(self):
ARPM = AnnotationRolePermissionManager
- getService(None,Adapters).provideAdapter(ITest,
+ ztapi.provideAdapter(ITest,
IRolePermissionManager, ARPM)
test = permissionRegistry.definePermission('test', 'Test', '')
test = test.getId()
@@ -275,7 +276,7 @@
def testPlayfulPrinciplePermissions(self):
APPM = AnnotationPrincipalPermissionManager
- getService(None,Adapters).provideAdapter(ITest,
+ ztapi.provideAdapter(ITest,
IPrincipalPermissionManager, APPM)
ob1 = TestClass()
More information about the Zope3-Checkins
mailing list