[z3-checkins] r5146 - in z3/Five/trunk/tests: . products/FiveTest

faassen at codespeak.net faassen at codespeak.net
Thu Jun 17 16:24:05 MEST 2004


Author: faassen
Date: Thu Jun 17 16:24:05 2004
New Revision: 5146

Modified:
   z3/Five/trunk/tests/products/FiveTest/simplecontent.py
   z3/Five/trunk/tests/test_five.py
Log:
Added another test to check whether fallback on old-style views still works.


Modified: z3/Five/trunk/tests/products/FiveTest/simplecontent.py
==============================================================================
--- z3/Five/trunk/tests/products/FiveTest/simplecontent.py	(original)
+++ z3/Five/trunk/tests/products/FiveTest/simplecontent.py	Thu Jun 17 16:24:05 2004
@@ -22,6 +22,12 @@
     def mymethod(self):
         return "Hello world"
 
+    security.declarePublic('direct')
+    def direct(self):
+        """Should be able to traverse directly to this as there is no view.
+        """
+        return "Direct traversal worked"
+    
 InitializeClass(SimpleContent)
 
 manage_addSimpleContentForm = PageTemplateFile(

Modified: z3/Five/trunk/tests/test_five.py
==============================================================================
--- z3/Five/trunk/tests/test_five.py	(original)
+++ z3/Five/trunk/tests/test_five.py	Thu Jun 17 16:24:05 2004
@@ -35,8 +35,7 @@
             "Adapted: The method",
             adapted.adaptedMethod())
 
-    def test_view1(self):
-        
+    def test_view1(self):        
         self.root.manage_addProduct['FiveTest'].manage_addSimpleContent(
             'testoid', 'Testoid')
         test = self.root.test
@@ -44,6 +43,13 @@
         self.assert_(isinstance(view, SimpleContentView))
         data = view()
         self.assertEquals('The eagle has landed', data)
+
+    def test_view_backwards_compatibility(self):
+        self.root.manage_addProduct['FiveTest'].manage_addSimpleContent(
+            'testoid', 'Testoid')
+        old_view = self.root.unrestrictedTraverse('testoid/direct')
+        data = old_view()
+        self.assertEquals('Direct traversal worked', data)
         
 if __name__ == '__main__':
     framework()


More information about the z3-checkins mailing list