[Zope-Checkins] CVS: Zope/lib/python/TAL/tests - test_talinterpreter.py:1.3.102.1

Florent Guillaume fg@nuxeo.com
Sun, 15 Sep 2002 20:00:47 -0400


Update of /cvs-repository/Zope/lib/python/TAL/tests
In directory cvs.zope.org:/tmp/cvs-serv1822/TAL/tests

Modified Files:
      Tag: Zope-2_6-i18n-branch
	test_talinterpreter.py 
Log Message:
Improved support for Unicode in TAL and ZPT.
Added tests that exercise that.


=== Zope/lib/python/TAL/tests/test_talinterpreter.py 1.3 => 1.3.102.1 ===
--- Zope/lib/python/TAL/tests/test_talinterpreter.py:1.3	Wed Oct 17 16:28:01 2001
+++ Zope/lib/python/TAL/tests/test_talinterpreter.py	Sun Sep 15 20:00:47 2002
@@ -68,6 +68,24 @@
         interp()
         self.assertEqual(sio.getvalue(), EXPECTED)
 
+    def check_unicode_content(self):
+        INPUT = """<p tal:content="python:u'déjà-vu'">para</p>"""
+        EXPECTED = u"""<p>déjà-vu</p>""" "\n"
+        program, macros = self._compile(INPUT)
+        sio = StringIO()
+        interp = TALInterpreter(program, {}, DummyEngine(), sio, wrap=60)
+        interp()
+        self.assertEqual(sio.getvalue(), EXPECTED)
+
+    def check_unicode_structure(self):
+        INPUT = """<p tal:replace="structure python:u'déjà-vu'">para</p>"""
+        EXPECTED = u"""déjà-vu""" "\n"
+        program, macros = self._compile(INPUT)
+        sio = StringIO()
+        interp = TALInterpreter(program, {}, DummyEngine(), sio, wrap=60)
+        interp()
+        self.assertEqual(sio.getvalue(), EXPECTED)
+
 
 def test_suite():
     suite = unittest.TestSuite()