diff options
author | Maurits van Rees <maurits@vanrees.org> | 2018-03-05 14:08:22 +0100 |
---|---|---|
committer | Maurits van Rees <maurits@vanrees.org> | 2018-03-05 14:08:22 +0100 |
commit | ed552e0fc71db76eca3d962b04fc1e4dca9fe3ae (patch) | |
tree | fed920842e4096bed9274e50141e6cc70fbaf277 /src/zope/tal/tests/test_talgettext.py | |
parent | 70a610e848e92cd76138ef342c7bd061882bdad1 (diff) | |
download | zope-tal-ed552e0fc71db76eca3d962b04fc1e4dca9fe3ae.tar.gz |
Added test for Python 3 unicode error translate.
Diffstat (limited to 'src/zope/tal/tests/test_talgettext.py')
-rw-r--r-- | src/zope/tal/tests/test_talgettext.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/zope/tal/tests/test_talgettext.py b/src/zope/tal/tests/test_talgettext.py index d3b57d0..1e3b3f9 100644 --- a/src/zope/tal/tests/test_talgettext.py +++ b/src/zope/tal/tests/test_talgettext.py @@ -118,6 +118,24 @@ class test_POEngine(unittest.TestCase): ['A <a href="${DYNAMIC_CONTENT}">link</a>.', 'Some ${DYNAMIC_CONTENT} text.']) + def test_potalinterpreter_translate_default(self): + sample_source = '<p i18n:translate="">text</p>' + p = HTMLTALParser() + p.parseString(sample_source) + program, macros = p.getCode() + engine = POEngine() + engine.file = 'sample_source' + interpreter = POTALInterpreter( + program, macros, engine, stream=StringIO(), metal=False) + # We simply call this, to make sure we don't get a NameError + # for 'unicode' in python 3. + # The return value (strangely: 'x') is not interesting here. + interpreter.translate('text') + msgids = [] + for domain in engine.catalog.values(): + msgids += list(domain) + self.assertIn('text', msgids) + def test_suite(): return unittest.defaultTestLoader.loadTestsFromName(__name__) |