[Checkins] SVN: five.pt/trunk/src/five/pt/tests/test_persistenttemplate.py add i18n tests
Leonardo Rochael Almeida
leorochael at gmail.com
Wed Feb 23 08:20:38 EST 2011
Log message for revision 120534:
add i18n tests
Changed:
U five.pt/trunk/src/five/pt/tests/test_persistenttemplate.py
-=-
Modified: five.pt/trunk/src/five/pt/tests/test_persistenttemplate.py
===================================================================
--- five.pt/trunk/src/five/pt/tests/test_persistenttemplate.py 2011-02-23 12:53:41 UTC (rev 120533)
+++ five.pt/trunk/src/five/pt/tests/test_persistenttemplate.py 2011-02-23 13:20:38 UTC (rev 120534)
@@ -24,11 +24,19 @@
macro_inner = """
<metal:use use-macro="here/macro_middle/macros/master">
<metal:fills fill-slot="main_slot">
- Inner Slot
+ <tal:block i18n:domain="mydomain" i18n:translate="">
+ Inner Slot
+ </tal:block>
</metal:fills>
</metal:use>
""".strip()
+simple_i18n = """
+<tal:block i18n:domain="mydomain" i18n:translate="">
+ Hello, World
+</tal:block>
+""".strip()
+
class TestPersistent(ZopeTestCase):
def afterSetUp(self):
from Products.Five import zcml
@@ -44,14 +52,13 @@
return manage_addPageTemplate(self.folder, template_id, text=source)
def test_simple(self):
- template = self._makeOne('foo',
- '<tal:block content="string:Hello, World" />')
- result = template()
+ template = self._makeOne('foo', simple_i18n)
+ result = template().strip()
self.assertEqual(result, u'Hello, World')
# check that it's editable
template.pt_editForm()
- def test_macro(self):
+ def test_macro_with_i18n(self):
self._makeOne('macro_outer', macro_outer)
self._makeOne('macro_middle', macro_middle)
inner = self._makeOne('macro_inner', macro_inner)
More information about the checkins
mailing list