[Zope-Checkins] CVS: Products/PageTemplates/tests - testExpressions.py:1.11.44.1

Chris McDonough chrism at plope.com
Sun Sep 25 09:44:03 EDT 2005


Update of /cvs-repository/Products/PageTemplates/tests
In directory cvs.zope.org:/tmp/cvs-serv24510/lib/python/Products/PageTemplates/tests

Modified Files:
      Tag: Zope-2_7-branch
	testExpressions.py 
Log Message:
Prevent 'render' function in Expressions.py for being called for basic types (minor speed improvement).  See  http://www.zope.org/Collectors/Zope/1890. 




=== Products/PageTemplates/tests/testExpressions.py 1.11 => 1.11.44.1 ===
--- Products/PageTemplates/tests/testExpressions.py:1.11	Thu Sep 26 17:33:17 2002
+++ Products/PageTemplates/tests/testExpressions.py	Sun Sep 25 09:44:02 2005
@@ -2,6 +2,11 @@
 
 from Products.PageTemplates import Expressions
 
+class Dummy:
+    __allow_access_to_unprotected_subobjects__ = 1
+    def __call__(self):
+        return 'dummy'
+
 class ExpressionTests(unittest.TestCase):
 
     def setUp(self):
@@ -10,6 +15,7 @@
             one = 1,
             d = {'one': 1, 'b': 'b', '': 'blank', '_': 'under'},
             blank = '',
+            dummy = Dummy()
             )
 
     def tearDown(self):
@@ -33,6 +39,10 @@
         assert ec.evaluate('one') == 1
         assert ec.evaluate('d/one') == 1
         assert ec.evaluate('d/b') == 'b'
+
+    def testRenderedEval(self):
+        ec = self.ec
+        assert ec.evaluate('dummy') == 'dummy'
 
     def testEval1(self):
         '''Test advanced expression evaluation 1'''



More information about the Zope-Checkins mailing list