[Zope3-checkins] CVS: Zope3/src/zope/app/security/grants/tests - test_annotationprincipalpermissionmanager.py:1.8 test_annotationprincipalrolemanager.py:1.9 test_annotationrolepermissionmanager.py:1.9

Jim Fulton cvs-admin at zope.org
Fri Nov 21 12:12:42 EST 2003


Update of /cvs-repository/Zope3/src/zope/app/security/grants/tests
In directory cvs.zope.org:/tmp/cvs-serv31883/src/zope/app/security/grants/tests

Modified Files:
	test_annotationprincipalpermissionmanager.py 
	test_annotationprincipalrolemanager.py 
	test_annotationrolepermissionmanager.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/grants/tests/test_annotationprincipalpermissionmanager.py 1.7 => 1.8 ===
--- Zope3/src/zope/app/security/grants/tests/test_annotationprincipalpermissionmanager.py:1.7	Sat Jun  7 01:46:04 2003
+++ Zope3/src/zope/app/security/grants/tests/test_annotationprincipalpermissionmanager.py	Fri Nov 21 12:12:11 2003
@@ -14,7 +14,7 @@
 """Test handler for AnnotationPrincipalPermissionManager module."""
 
 import unittest
-
+from zope.app.tests import ztapi
 from zope.app.interfaces.annotation import IAttributeAnnotatable
 from zope.component import getService
 from zope.app.services.servicenames import Adapters
@@ -37,7 +37,7 @@
 
     def setUp(self):
         PlacelessSetup.setUp(self)
-        getService(None,Adapters).provideAdapter(
+        ztapi.provideAdapter(
             IAttributeAnnotatable, IAnnotations,
             AttributeAnnotations)
 


=== Zope3/src/zope/app/security/grants/tests/test_annotationprincipalrolemanager.py 1.8 => 1.9 ===
--- Zope3/src/zope/app/security/grants/tests/test_annotationprincipalrolemanager.py:1.8	Tue Sep 30 09:44:08 2003
+++ Zope3/src/zope/app/security/grants/tests/test_annotationprincipalrolemanager.py	Fri Nov 21 12:12:11 2003
@@ -14,7 +14,7 @@
 """Test handler for PrincipalRoleManager module."""
 
 import unittest
-
+from zope.app.tests import ztapi
 from zope.app.interfaces.annotation import IAttributeAnnotatable
 from zope.component import getService
 from zope.app.services.servicenames import Adapters
@@ -36,7 +36,7 @@
 
     def setUp(self):
         PlacefulSetup.setUp(self)
-        getService(None, Adapters).provideAdapter(
+        ztapi.provideAdapter(
             IAttributeAnnotatable, IAnnotations,
             AttributeAnnotations)
 


=== Zope3/src/zope/app/security/grants/tests/test_annotationrolepermissionmanager.py 1.8 => 1.9 ===
--- Zope3/src/zope/app/security/grants/tests/test_annotationrolepermissionmanager.py:1.8	Sat Jun  7 01:46:04 2003
+++ Zope3/src/zope/app/security/grants/tests/test_annotationrolepermissionmanager.py	Fri Nov 21 12:12:11 2003
@@ -11,6 +11,7 @@
 # FOR A PARTICULAR PURPOSE.
 #
 ##############################################################################
+from zope.app.tests import ztapi
 from zope.app.security.grants.rolepermission \
      import AnnotationRolePermissionManager
 from zope.app.interfaces.annotation import IAttributeAnnotatable
@@ -41,9 +42,8 @@
         defineService(Permissions, IPermissionService)
         provideService('Roles', roleRegistry)
         provideService(Permissions, permissionRegistry)
-        provideAdapter=getService(None,Adapters).provideAdapter
-        provideAdapter(IAttributeAnnotatable, IAnnotations,
-                       AttributeAnnotations)
+        ztapi.provideAdapter(IAttributeAnnotatable, IAnnotations,
+                             AttributeAnnotations)
 
         read = permissionRegistry.definePermission('read', 'Read Something')
         self.read = read.getId()




More information about the Zope3-Checkins mailing list