[Zope3-checkins] CVS: Zope3/src/zope/app/publication/tests - test_browserpublication.py:1.26 test_xmlrpcpublication.py:1.7 test_zopepublication.py:1.28

Philipp von Weitershausen philikon at philikon.de
Wed Mar 17 13:24:57 EST 2004


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

Modified Files:
	test_browserpublication.py test_xmlrpcpublication.py 
	test_zopepublication.py 
Log Message:


The traversing machinery now uses views providing an interface
(IPublishTraverse or subclassing interfaces) instead of views named
"_traverse".




=== Zope3/src/zope/app/publication/tests/test_browserpublication.py 1.25 => 1.26 ===
--- Zope3/src/zope/app/publication/tests/test_browserpublication.py:1.25	Mon Mar 15 15:42:09 2004
+++ Zope3/src/zope/app/publication/tests/test_browserpublication.py	Wed Mar 17 13:24:26 2004
@@ -47,7 +47,6 @@
     return '<html><body>hello base fans</body></html>'
 
 class DummyPublished:
-
     implements(IBrowserPublisher)
 
     def publishTraverse(self, request, name):
@@ -122,7 +121,7 @@
 
         ztapi.browserView(I1, 'view', DummyView)
         ztapi.setDefaultViewName(I1, 'view')
-        ztapi.browserView(None, '_traverse', TestTraverser)
+        ztapi.browserViewProviding(None, TestTraverser, IBrowserPublisher)
 
         ob = O1()
 
@@ -173,7 +172,7 @@
                 self.counter += 1
                 return self.context[name]
 
-        ztapi.browserView(I1, '_traverse', Adapter)
+        ztapi.browserViewProviding(I1, Adapter, IBrowserPublisher)
         ob = mydict()
         ob['bruce'] = SimpleObject('bruce')
         ob['bruce2'] = SimpleObject('bruce2')
@@ -192,10 +191,10 @@
             def browserDefault(self, request):
                 return (self.context['bruce'], 'dummy')
 
-        ztapi.browserView(I1, '_traverse', Adapter)
+        ztapi.browserViewProviding(I1, Adapter, IBrowserPublisher)
         ob = mydict()
-        ob['bruce'] =  SimpleObject('bruce')
-        ob['bruce2'] =  SimpleObject('bruce2')
+        ob['bruce'] = SimpleObject('bruce')
+        ob['bruce2'] = SimpleObject('bruce2')
         pub = self.klass(self.db)
         ob2, x = pub.getDefaultTraversal(self._createRequest('/bruce',pub), ob)
         self.assertEqual(x, 'dummy')
@@ -229,7 +228,7 @@
             x = SimpleObject(1)
         ob = C()
         r = self._createRequest('/x',pub)
-        ztapi.browserView(None, '_traverse', TestTraverser)
+        ztapi.browserViewProviding(None, TestTraverser, IBrowserPublisher)
         ob2 = pub.traverseName(r, ob, 'x')
         self.assertRaises(ForbiddenAttribute, getattr, ob2, 'v')
         self.assertEqual(removeAllProxies(ob2).v, 1)


=== Zope3/src/zope/app/publication/tests/test_xmlrpcpublication.py 1.6 => 1.7 ===
--- Zope3/src/zope/app/publication/tests/test_xmlrpcpublication.py:1.6	Mon Mar 15 15:42:09 2004
+++ Zope3/src/zope/app/publication/tests/test_xmlrpcpublication.py	Wed Mar 17 13:24:26 2004
@@ -28,6 +28,7 @@
 from zope.publisher.interfaces import NotFound
 from zope.publisher.interfaces.xmlrpc import IXMLRPCPresentation
 from zope.publisher.interfaces.xmlrpc import IXMLRPCRequest
+from zope.publisher.interfaces.xmlrpc import IXMLRPCPublisher
 from zope.publisher.xmlrpc import TestRequest
 
 
@@ -51,8 +52,9 @@
             x = SimpleObject(1)
         ob = C()
         r = self._createRequest('/x', pub)
-        provideView=getService(None, Presentation).provideView
-        provideView(None, '_traverse', IXMLRPCRequest, TestTraverser)
+        provideView = getService(None, Presentation).provideView
+        provideView(None, '', IXMLRPCRequest, TestTraverser,
+                    providing=IXMLRPCPublisher)
         ob2 = pub.traverseName(r, ob, 'x')
         self.assertEqual(removeAllProxies(ob2).v, 1)
 


=== Zope3/src/zope/app/publication/tests/test_zopepublication.py 1.27 => 1.28 ===
--- Zope3/src/zope/app/publication/tests/test_zopepublication.py:1.27	Mon Mar 15 15:42:09 2004
+++ Zope3/src/zope/app/publication/tests/test_zopepublication.py	Wed Mar 17 13:24:26 2004
@@ -27,7 +27,7 @@
 from zope.component.interfaces import IServiceService
 from zope.publisher.base import TestPublication
 from zope.publisher.http import IHTTPRequest, HTTPCharsets
-from zope.publisher.interfaces import IRequest
+from zope.publisher.interfaces import IRequest, IPublishTraverse
 from zope.security import simplepolicies
 from zope.security.management import setSecurityPolicy, getSecurityManager
 
@@ -288,8 +288,8 @@
         from zope.app.container.traversal import ContainerTraverser
 
         s = zapi.getService(None, zapi.servicenames.Presentation) 
-        s.provideView(ISimpleReadContainer, '_traverse', IRequest,
-                      ContainerTraverser)
+        s.provideView(ISimpleReadContainer, '', IRequest,
+                      ContainerTraverser, providing=IPublishTraverse)
 
         from zope.app.folder.interfaces import IFolder
         from zope.security.checker import defineChecker, InterfaceChecker




More information about the Zope3-Checkins mailing list