[Zope3-checkins] CVS: Zope3/src/zope/app/publisher/browser/tests -
test_directives.py:1.35
Garrett Smith
garrett at mojave-corp.com
Fri Apr 9 10:18:37 EDT 2004
Update of /cvs-repository/Zope3/src/zope/app/publisher/browser/tests
In directory cvs.zope.org:/tmp/cvs-serv11414/src/zope/app/publisher/browser/tests
Modified Files:
test_directives.py
Log Message:
Added support for page lookup for a view when the view has a
'publishTraverse' method. This is something I had missed in an earlier
checkin.
=== Zope3/src/zope/app/publisher/browser/tests/test_directives.py 1.34 => 1.35 ===
--- Zope3/src/zope/app/publisher/browser/tests/test_directives.py:1.34 Thu Apr 8 11:34:03 2004
+++ Zope3/src/zope/app/publisher/browser/tests/test_directives.py Fri Apr 9 10:18:37 2004
@@ -613,6 +613,33 @@
view = getView(ob, 'test', request)
view = removeAllProxies(view)
view.publishTraverse(request, 'index.html')
+
+ def testTraversalOfPageForViewWithPublishTraverse(self):
+ """Tests proper traversal of a page defined for a view.
+
+ This test is different from testTraversalOfPageForView in that it
+ tests the behavior on a view that has a publishTraverse method --
+ the implementation of the lookup is slightly different in such a
+ case.
+ """
+ xmlconfig(StringIO(template %
+ """
+ <browser:view
+ name="test"
+ class="zope.app.publisher.browser.tests.test_directives.VT"
+ for="zope.app.component.tests.views.IC"
+ permission="zope.Public" />
+
+ <browser:page name="index.html"
+ for="zope.app.component.tests.views.IV"
+ class="zope.app.publisher.browser.tests.test_directives.CV"
+ permission="zope.Public" />
+ """
+ ))
+
+ view = getView(ob, 'test', request)
+ view = removeAllProxies(view)
+ view.publishTraverse(request, 'index.html')
def testProtectedPageViews(self):
ztapi.provideUtility(IPermission, Permission('p', 'P'), 'p')
More information about the Zope3-Checkins
mailing list