[Zope3-checkins] CVS: Zope3/src/zope/app/publication/tests - test_zopepublication.py:1.11

Marius Gedminas mgedmin@codeworks.lt
Thu, 20 Mar 2003 07:09:02 -0500


Update of /cvs-repository/Zope3/src/zope/app/publication/tests
In directory cvs.zope.org:/tmp/cvs-serv7357/src/zope/app/publication/tests

Modified Files:
	test_zopepublication.py 
Log Message:
Fixed broken local authentication in ZopePublication: IServiceManager has no
'get' method, use 'queryService' instead.


=== Zope3/src/zope/app/publication/tests/test_zopepublication.py 1.10 => 1.11 ===
--- Zope3/src/zope/app/publication/tests/test_zopepublication.py:1.10	Thu Mar 13 13:49:08 2003
+++ Zope3/src/zope/app/publication/tests/test_zopepublication.py	Thu Mar 20 07:09:01 2003
@@ -50,6 +50,8 @@
 from transaction import get_transaction
 from cStringIO import StringIO
 
+from zope.app.services.servicenames import Authentication
+
 class BasePublicationTests(PlacelessSetup, unittest.TestCase):
 
     def setUp(self):
@@ -129,17 +131,11 @@
     def __init__(self, auth):
         self.auth = auth
 
-    def get(self, key, d=None):
-        return self.auth
-
-    __getitem__ = get
-
-    def __contains__(self, key):
-        return 1
-
-    def getService(self, name):
-        # I just wanna get the test to pass. Waaaaa
-        return serviceManager.getService(name)
+    def queryService(self, name, default=None):
+        if name == Authentication:
+            return self.auth
+        else:
+            return default
 
 
 class ZopePublicationErrorHandling(BasePublicationTests):