[Zope-Checkins] CVS: Zope3/lib/python/Zope/TAL/tests - test_htmltalparser.py:1.32

Barry Warsaw barry@wooz.org
Mon, 17 Jun 2002 20:19:03 -0400


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

Modified Files:
	test_htmltalparser.py 
Log Message:
check_i18n_explicit_msgid_with_name(): Add a test for i18n:name inside
an explicit message id tag.  This used to not evaluate the contents of
the tag.


=== Zope3/lib/python/Zope/TAL/tests/test_htmltalparser.py 1.31 => 1.32 ===
   ])
 
+    def check_i18n_explicit_msgid_with_name(self):
+        self._run_check('''\
+<span i18n:translate="jobnum">
+    Job #<span tal:replace="context/@@object_name"
+               i18n:name="jobnum">NN</span></span>
+''', [
+  ('setPosition', (1, 0)),
+  ('beginScope', {'i18n:translate': 'jobnum'}),
+  ('startTag', ('span', [('i18n:translate', 'jobnum', 'i18n')])),
+  ('insertTranslation',
+   ('jobnum',
+    [('rawtextBeginScope',
+      ('\n    Job #',
+       9,
+       (2, 9),
+       0,
+       {'i18n:name': 'jobnum', 'tal:replace': 'context/@@object_name'})),
+     ('i18nVariable',
+      ('jobnum',
+       '$context/@@object_name$',
+       [('startTag',
+         ('span',
+          [('tal:replace', 'context/@@object_name', 'tal'),
+           ('i18n:name', 'jobnum', 'i18n')])),
+        ('rawtextOffset', ('NN</span>', 9))])),
+     ('endScope', ())])),
+  ('endScope', ()),
+  ('rawtextColumn', ('</span>\n', 0))
+  ])
+
 
 def test_suite():
     suite = unittest.TestSuite()