Mercurial > genshi > genshi-test
diff genshi/filters/tests/i18n.py @ 595:6d51c8df5d5a stable-0.4.x
Ported [708] to 0.4.x branch.
author | cmlenz |
---|---|
date | Mon, 13 Aug 2007 23:04:50 +0000 |
parents | d8ccbef91504 |
children | 2c52ec2c9d7e |
line wrap: on
line diff
--- a/genshi/filters/tests/i18n.py +++ b/genshi/filters/tests/i18n.py @@ -21,6 +21,16 @@ class TranslatorTestCase(unittest.TestCase): + def test_extract_without_text(self): + tmpl = MarkupTemplate("""<html xmlns:py="http://genshi.edgewall.org/"> + <p title="Bar">Foo</p> + ${ngettext("Singular", "Plural", num)} + </html>""") + translator = Translator(extract_text=False) + messages = list(translator.extract(tmpl.stream)) + self.assertEqual(1, len(messages)) + self.assertEqual((3, 'ngettext', (u'Singular', u'Plural')), messages[0]) + def test_extract_plural_form(self): tmpl = MarkupTemplate("""<html xmlns:py="http://genshi.edgewall.org/"> ${ngettext("Singular", "Plural", num)}