[Zope-Checkins]
SVN: Zope/branches/ajung-zpt-encoding-fixes/lib/python/Products/PageTemplates/tests/testZopePageTemplate.py
more tests
Andreas Jung
andreas at andreas-jung.com
Mon Dec 18 14:13:07 EST 2006
Log message for revision 71594:
more tests
Changed:
U Zope/branches/ajung-zpt-encoding-fixes/lib/python/Products/PageTemplates/tests/testZopePageTemplate.py
-=-
Modified: Zope/branches/ajung-zpt-encoding-fixes/lib/python/Products/PageTemplates/tests/testZopePageTemplate.py
===================================================================
--- Zope/branches/ajung-zpt-encoding-fixes/lib/python/Products/PageTemplates/tests/testZopePageTemplate.py 2006-12-18 19:06:33 UTC (rev 71593)
+++ Zope/branches/ajung-zpt-encoding-fixes/lib/python/Products/PageTemplates/tests/testZopePageTemplate.py 2006-12-18 19:13:06 UTC (rev 71594)
@@ -104,6 +104,17 @@
self.assertEqual(result.encode('utf-8').startswith(utf8_str), True)
self.assertEqual(zpt.output_encoding, 'iso-8859-15')
+ def testWriteAcceptsUnicode(self):
+ manage_addPageTemplate(self.app, 'test', '', encoding='utf-8')
+ zpt = self.app['test']
+ zpt.write(u'this is unicode')
+
+ def testWriteWontAcceptsNonUnicode(self):
+ manage_addPageTemplate(self.app, 'test', '', encoding='utf-8')
+ zpt = self.app['test']
+ self.assertRaises(TypeError, zpt.write, 'this is not unicode')
+
+
def _createZPT(self):
manage_addPageTemplate(self.app, 'test', text=utf8_str, encoding='utf-8')
zpt = self.app['test']
More information about the Zope-Checkins
mailing list