[Zope3-checkins] CVS: Zope3/src/zope/app/publisher/browser/tests -
test_directives.py:1.34
Garrett Smith
garrett at mojave-corp.com
Thu Apr 8 11:34:04 EDT 2004
Update of /cvs-repository/Zope3/src/zope/app/publisher/browser/tests
In directory cvs.zope.org:/tmp/cvs-serv19674/src/zope/app/publisher/browser/tests
Modified Files:
test_directives.py
Log Message:
Added support for traversing pages on views without specifying '@@'.
Prior to this change, a page named 'foo.html' for a view (that was not
declared inside the 'view' element) would have to be traversed using
'view/@@foo.html'. Now it can also be traversed using the name directly,
as in 'view/foo.html'.
For additional clarification, refer to the test.
=== Zope3/src/zope/app/publisher/browser/tests/test_directives.py 1.33 => 1.34 ===
--- Zope3/src/zope/app/publisher/browser/tests/test_directives.py:1.33 Tue Mar 23 17:08:10 2004
+++ Zope3/src/zope/app/publisher/browser/tests/test_directives.py Thu Apr 8 11:34:03 2004
@@ -592,6 +592,28 @@
v = removeAllProxies(v)
self.assertEqual(str(v()), '<html><body><p>done</p></body></html>\n')
+ def testTraversalOfPageForView(self):
+ """Tests proper traversal of a page defined for a view."""
+
+ xmlconfig(StringIO(template %
+ """
+ <browser:view
+ name="test"
+ class="zope.app.component.tests.views.V1"
+ 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