[Checkins] SVN: Zope/trunk/lib/python/Products/PageTemplates/tests/testZopePageTemplate.py test for unicode workaround in ZRPythonExpr

Andreas Jung andreas at andreas-jung.com
Wed Feb 21 06:36:18 EST 2007


Log message for revision 72743:
  test for unicode workaround in ZRPythonExpr
  

Changed:
  U   Zope/trunk/lib/python/Products/PageTemplates/tests/testZopePageTemplate.py

-=-
Modified: Zope/trunk/lib/python/Products/PageTemplates/tests/testZopePageTemplate.py
===================================================================
--- Zope/trunk/lib/python/Products/PageTemplates/tests/testZopePageTemplate.py	2007-02-21 11:00:37 UTC (rev 72742)
+++ Zope/trunk/lib/python/Products/PageTemplates/tests/testZopePageTemplate.py	2007-02-21 11:36:18 UTC (rev 72743)
@@ -132,6 +132,15 @@
         self.assertEqual(result.encode('ascii').startswith(ascii_str), True)
         self.assertEqual(zpt.output_encoding, 'iso-8859-15')
 
+    def testPT_RenderUnicodeExpr(self):
+        # Check workaround for unicode incompatibility of ZRPythonExpr.
+        # See http://mail.zope.org/pipermail/zope/2007-February/170537.html
+        manage_addPageTemplate(self.app, 'test', 
+                               text='<span tal:content="python: unicode(\'\xfe\', \'iso-8859-15\')" />',
+                               encoding='iso-8859-15')
+        zpt = self.app['test']
+        result = zpt.pt_render() # should not raise a UnicodeDecodeError
+
     def testPT_RenderWithISO885915(self):
         manage_addPageTemplate(self.app, 'test', text=iso885915_str, encoding='iso-8859-15')
         zpt = self.app['test']



More information about the Checkins mailing list