[Zope3-checkins] CVS: Zope3/src/zope/app/services/tests - test_view.py:1.19

Jeremy Hylton jeremy@zope.com
Tue, 24 Jun 2003 11:38:05 -0400


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

Modified Files:
	test_view.py 
Log Message:
Hook up the local and global view services for interface queries.

getRegistrationsForInterface() propagates the query to the next service if it also supports IInterfaceBasedRegistry.

Add an adapter for the GlobalViewService to support IInterfaceBasedRegistry.  The adapter goes here, because the global service is in zope.component, which shouldn't depend on zope.app.

Convert the global views to registrations so that they can be passed back from getRegistrationsForInterface().


=== Zope3/src/zope/app/services/tests/test_view.py 1.18 => 1.19 ===
--- Zope3/src/zope/app/services/tests/test_view.py:1.18	Mon Jun 23 12:20:08 2003
+++ Zope3/src/zope/app/services/tests/test_view.py	Tue Jun 24 11:38:04 2003
@@ -129,8 +129,6 @@
                           service.getView, O(), 'test', request)
 
     def test_queryView_and_getView(self):
-        service = self._service
-
         sm = traverse(self.rootFolder, '++etc++site')
 
         registration_manager = traverse(sm, 'default').getRegistrationManager()
@@ -142,7 +140,7 @@
 
         registration.factory = A
 
-        registry = service.createRegistrationsFor(registration)
+        registry = self._service.createRegistrationsFor(registration)
         registry.register(registration)
         registry.activate(registration)
 
@@ -154,7 +152,7 @@
                 o = O()
                 directlyProvides(o, r)
 
-                view = getattr(service, m)(o, 'test', request)
+                view = getattr(self._service, m)(o, 'test', request)
                 self.assertEqual(view.__class__, A)
                 self.assertEqual(view.context, o)
                 self.assertEqual(view.request, request)