[Zope3-checkins] CVS: Zope3/src/zope/tal/tests - test_talinterpreter.py:1.3.4.6

Stephan Richter srichter at cosmos.phy.tufts.edu
Fri Aug 8 14:57:37 EDT 2003


Update of /cvs-repository/Zope3/src/zope/tal/tests
In directory cvs.zope.org:/tmp/cvs-serv3326/src/zope/tal/tests

Modified Files:
      Tag: srichter-i18n-macro-interaction-branch
	test_talinterpreter.py 
Log Message:
Split up the final bug into two cases.


=== Zope3/src/zope/tal/tests/test_talinterpreter.py 1.3.4.5 => 1.3.4.6 ===
--- Zope3/src/zope/tal/tests/test_talinterpreter.py:1.3.4.5	Fri Aug  8 13:15:34 2003
+++ Zope3/src/zope/tal/tests/test_talinterpreter.py	Fri Aug  8 13:57:32 2003
@@ -19,7 +19,7 @@
 
 from StringIO import StringIO
 
-from zope.tal.taldefs import METALError, I18NError
+from zope.tal.taldefs import METALError, TALError, I18NError
 from zope.tal.htmltalparser import HTMLTALParser
 from zope.tal.talinterpreter import TALInterpreter
 from zope.tal.dummyengine import DummyEngine
@@ -70,7 +70,7 @@
         self.interpreter()
         self.assertEqual(expected, result.getvalue())
 
-    def test_simple_messageid_translate(self):
+    def _test_simple_messageid_translate(self):
         # This test is mainly here to make sure our DummyEngine works
         # correctly.
         program, macros = self._compile('<span tal:content="foo"/>')
@@ -79,28 +79,28 @@
         program, macros = self._compile('<span tal:replace="foo"/>')
         self._check(program, 'FOOVALUE\n')
 
-    def test_replace_with_messageid_and_i18nname(self):
+    def _test_replace_with_messageid_and_i18nname(self):
         program, macros = self._compile(
             '<div i18n:translate="" >'
             '<span tal:replace="foo" i18n:name="foo_name"/>'
             '</div>')
         self._check(program, '<div>FOOVALUE</div>\n')
 
-    def test_pythonexpr_replace_with_messageid_and_i18nname(self):
+    def _test_pythonexpr_replace_with_messageid_and_i18nname(self):
         program, macros = self._compile(
             '<div i18n:translate="" >'
             '<span tal:replace="python: foo" i18n:name="foo_name"/>'
             '</div>')
         self._check(program, '<div>FOOVALUE</div>\n')
 
-    def test_structure_replace_with_messageid_and_i18nname(self):
+    def _test_structure_replace_with_messageid_and_i18nname(self):
         program, macros = self._compile(
             '<div i18n:translate="" >'
             '<span tal:replace="structure foo" i18n:name="foo_name"/>'
             '</div>')
         self._check(program, '<div>FOOVALUE</div>\n')
 
-    def test_complex_replace_with_messageid_and_i18nname(self):
+    def _test_complex_replace_with_messageid_and_i18nname(self):
         program, macros = self._compile(
             '<div i18n:translate="" >'
             '<em i18n:name="foo_name">'
@@ -109,17 +109,24 @@
             '</div>')
         self._check(program, '<div>FOOVALUE</div>\n')
 
-    def test_content_with_messageid_and_i18nname(self):
+    def _test_content_with_messageid_and_i18nname(self):
         program, macros = self._compile(
             '<div i18n:translate="" >'
             '<span tal:content="foo" i18n:name="foo_name"/>'
             '</div>')
         self._check(program, '<div><span>FOOVALUE</span></div>\n')
 
+    def test_content_with_messageid_and_i18nname_and_i18ntranslate(self):
         program, macros = self._compile(
             '<span i18n:translate="" tal:content="foo" i18n:name="foo_name"/>'
             )
         self._check(program, '<span>FOOVALUE</span>\n')
+
+    def test_content_with_plaintext_and_i18nname_and_i18ntranslate(self):
+        # Let's tell the user this is incredibly silly!
+        self.assertRaises(
+            TALError, self._compile,
+            '<span i18n:translate="" i18n:name="color_name">green</span>')
 
 
 class I18NErrorsTestCase(TestCaseBase):




More information about the Zope3-Checkins mailing list