[z3-checkins] r9722 - in z3/Five/branch/jw-calling_view_fails: . tests tests/products/FiveTest

jw at codespeak.net jw at codespeak.net
Wed Mar 9 16:58:05 MET 2005


Author: jw
Date: Wed Mar  9 16:58:05 2005
New Revision: 9722

Added:
   z3/Five/branch/jw-calling_view_fails/
      - copied from r9685, z3/Five/trunk/
Modified:
   z3/Five/branch/jw-calling_view_fails/tests/products/FiveTest/browser.py
   z3/Five/branch/jw-calling_view_fails/tests/products/FiveTest/configure.zcml
   z3/Five/branch/jw-calling_view_fails/tests/test_five.py
Log:
Extra testcase that currently fails.

In this testcase I define a view ('callingview'), that will
lookup and call another view ('condor.html'). This currently 
fails.

I think needs to be fixed in Five, but I don't know how at
this point.



Modified: z3/Five/branch/jw-calling_view_fails/tests/products/FiveTest/browser.py
==============================================================================
--- z3/Five/trunk/tests/products/FiveTest/browser.py	(original)
+++ z3/Five/branch/jw-calling_view_fails/tests/products/FiveTest/browser.py	Wed Mar  9 16:58:05 2005
@@ -1,3 +1,5 @@
+from zope.app import zapi
+
 from Products.Five import BrowserView
 from Products.Five import StandardMacros as BaseMacros
 
@@ -55,3 +57,10 @@
     macro_pages = ('bird_macros', 'dog_macros')
     aliases = {'flying':'birdmacro',
                'walking':'dogmacro'}
+
+class CallingOtherView(BrowserView):
+    
+    def render(self):
+        view = zapi.getView(self.context, 'condor.html', self.request)
+        return view()
+    
\ No newline at end of file

Modified: z3/Five/branch/jw-calling_view_fails/tests/products/FiveTest/configure.zcml
==============================================================================
--- z3/Five/trunk/tests/products/FiveTest/configure.zcml	(original)
+++ z3/Five/branch/jw-calling_view_fails/tests/products/FiveTest/configure.zcml	Wed Mar  9 16:58:05 2005
@@ -169,6 +169,14 @@
       permission="zope2.ViewManagementScreens"
       />
 
+  <browser:page
+    for=".interfaces.ISimpleContent"
+    class=".browser.CallingOtherView"
+    name="callingcondor"
+    attribute="render"
+    permission="zope2.ViewManagementScreens"
+  />
+  
   <!-- test TALES -->
   <browser:page
       for=".interfaces.ISimpleContent"

Modified: z3/Five/branch/jw-calling_view_fails/tests/test_five.py
==============================================================================
--- z3/Five/trunk/tests/test_five.py	(original)
+++ z3/Five/branch/jw-calling_view_fails/tests/test_five.py	Wed Mar  9 16:58:05 2005
@@ -141,6 +141,15 @@
 """
         self.assertEquals(expected, view())
 
+    def test_calling_otherview(self):
+        view = self.folder.unrestrictedTraverse('testoid/callingcondor')
+        expected = """\
+<p>Hello world</p>
+<p>The eagle has landed</p>
+<p>Hello world</p>
+"""
+        self.assertEquals(expected, view())
+        
     def test_repeat(self):
         view = self.folder.unrestrictedTraverse('testoid/ostrich.html')
         expected = """\


More information about the z3-checkins mailing list