[Zope-Checkins]
SVN: Zope/branches/philikon-aq/lib/python/Products/Five/browser/tests/aqlegacy_ftest.txt
Added a test for the first of three problems found in real
life applications with the ViewPageTemplateFile
Hanno Schlichting
plone at hannosch.info
Tue Apr 15 16:23:53 EDT 2008
Log message for revision 85385:
Added a test for the first of three problems found in real life applications with the ViewPageTemplateFile
Changed:
U Zope/branches/philikon-aq/lib/python/Products/Five/browser/tests/aqlegacy_ftest.txt
-=-
Modified: Zope/branches/philikon-aq/lib/python/Products/Five/browser/tests/aqlegacy_ftest.txt
===================================================================
--- Zope/branches/philikon-aq/lib/python/Products/Five/browser/tests/aqlegacy_ftest.txt 2008-04-15 15:15:28 UTC (rev 85384)
+++ Zope/branches/philikon-aq/lib/python/Products/Five/browser/tests/aqlegacy_ftest.txt 2008-04-15 20:23:28 UTC (rev 85385)
@@ -163,6 +163,27 @@
<p>The falcon has taken flight</p>
+Testing keyword arguments
+=========================
+
+ViewPageTemplateFile's take arbitrary keyword arguments:
+
+ >>> view = getMultiAdapter((self.folder, request), name='template')
+ >>> template = view.template
+ >>> print template(foo=1, bar=2)
+ <p>The falcon has taken flight</p>
+
+ XXX This fails currently with an error:
+ TypeError: __call__() got multiple values for keyword argument 'instance'
+
+ KSS is one example which passes in a keyword argument called 'instance' and
+ the Five ViewPageTemplateFile supported it. In the zope.app.pagetemplate
+ version, the first required argument is called instance.
+
+ >>> print template(instance='allowed')
+ <p>The falcon has taken flight</p>
+
+
Clean up
--------
More information about the Zope-Checkins
mailing list