Assert that views of the form

  class MyView(BrowserView):

      __call__ = ViewPageTemplateFile('...')

work.
parent 0e27cc13
......@@ -16,6 +16,7 @@
$Id$
"""
from Products.Five import BrowserView
from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile
class SimpleView(BrowserView):
"""More docstring. Please Zope"""
......@@ -39,6 +40,10 @@ class CallView(BrowserView):
def __call__(self):
return u"I was __call__()'ed"
class CallTemplate(BrowserView):
__call__ = ViewPageTemplateFile('falcon.pt')
class CallableNoDocstring:
def __call__(self):
......
......@@ -161,6 +161,13 @@
permission="zope2.Public"
/>
<browser:page
for="Products.Five.tests.testing.simplecontent.ISimpleContent"
class=".pages.CallTemplate"
name="calltemplate.html"
permission="zope2.Public"
/>
<!-- pages from methods/functions/callables that don't have docstrings -->
<browser:pages
for="Products.Five.tests.testing.simplecontent.ISimpleContent"
......
......@@ -144,6 +144,14 @@ class bearing only a __call__ method:
...
I was __call__()'ed
or a __call__ object that's callable, such as a ViewPageTemplateFile:
>>> print http(r'''
... GET /test_folder_1_/testoid/calltemplate.html HTTP/1.1
... ''')
HTTP/1.1 200 OK
...
<p>The falcon has taken flight</p>
Clean up
--------
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment