[Zope-Checkins] SVN: Zope/branches/philikon-aq/lib/python/Products/Five/browser/tests/pages Assert that views of the form

Philipp von Weitershausen philikon at philikon.de
Mon Jul 30 17:11:51 EDT 2007


Log message for revision 78483:
  Assert that views of the form
  
    class MyView(BrowserView):
  
        __call__ = ViewPageTemplateFile('...')
  
  work.
  

Changed:
  U   Zope/branches/philikon-aq/lib/python/Products/Five/browser/tests/pages.py
  U   Zope/branches/philikon-aq/lib/python/Products/Five/browser/tests/pages.zcml
  U   Zope/branches/philikon-aq/lib/python/Products/Five/browser/tests/pages_ftest.txt

-=-
Modified: Zope/branches/philikon-aq/lib/python/Products/Five/browser/tests/pages.py
===================================================================
--- Zope/branches/philikon-aq/lib/python/Products/Five/browser/tests/pages.py	2007-07-30 21:10:41 UTC (rev 78482)
+++ Zope/branches/philikon-aq/lib/python/Products/Five/browser/tests/pages.py	2007-07-30 21:11:50 UTC (rev 78483)
@@ -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 @@
     def __call__(self):
         return u"I was __call__()'ed"
 
+class CallTemplate(BrowserView):
+
+    __call__ = ViewPageTemplateFile('falcon.pt')
+
 class CallableNoDocstring:
 
     def __call__(self):

Modified: Zope/branches/philikon-aq/lib/python/Products/Five/browser/tests/pages.zcml
===================================================================
--- Zope/branches/philikon-aq/lib/python/Products/Five/browser/tests/pages.zcml	2007-07-30 21:10:41 UTC (rev 78482)
+++ Zope/branches/philikon-aq/lib/python/Products/Five/browser/tests/pages.zcml	2007-07-30 21:11:50 UTC (rev 78483)
@@ -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"

Modified: Zope/branches/philikon-aq/lib/python/Products/Five/browser/tests/pages_ftest.txt
===================================================================
--- Zope/branches/philikon-aq/lib/python/Products/Five/browser/tests/pages_ftest.txt	2007-07-30 21:10:41 UTC (rev 78482)
+++ Zope/branches/philikon-aq/lib/python/Products/Five/browser/tests/pages_ftest.txt	2007-07-30 21:11:50 UTC (rev 78483)
@@ -144,7 +144,15 @@
   ...
   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
 --------
 



More information about the Zope-Checkins mailing list