Commit 02d2e052 authored by Andreas Jung's avatar Andreas Jung

test for unicode workaround in ZRPythonExpr

parent 39b5abc8
...@@ -132,6 +132,15 @@ class ZopePageTemplateFileTests(ZopeTestCase): ...@@ -132,6 +132,15 @@ class ZopePageTemplateFileTests(ZopeTestCase):
self.assertEqual(result.encode('ascii').startswith(ascii_str), True) self.assertEqual(result.encode('ascii').startswith(ascii_str), True)
self.assertEqual(zpt.output_encoding, 'iso-8859-15') 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): def testPT_RenderWithISO885915(self):
manage_addPageTemplate(self.app, 'test', text=iso885915_str, encoding='iso-8859-15') manage_addPageTemplate(self.app, 'test', text=iso885915_str, encoding='iso-8859-15')
zpt = self.app['test'] zpt = self.app['test']
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment