summaryrefslogtreecommitdiff
path: root/tests/i18n/test_extraction.py
diff options
context:
space:
mode:
authorJason Myers <jason@jasonamyers.com>2013-11-02 23:36:09 -0500
committerJason Myers <jason@jasonamyers.com>2013-11-02 23:50:49 -0500
commit7a61c68c50d3837c50e35c252fd76220f08b5290 (patch)
tree586f16a3f02c2b45ffb3dd2af834c0ef604e099c /tests/i18n/test_extraction.py
parent0fdb692c6c94d912f17a3e2ad12413fb072d38ec (diff)
downloaddjango-7a61c68c50d3837c50e35c252fd76220f08b5290.tar.gz
PEP8 cleanup
Signed-off-by: Jason Myers <jason@jasonamyers.com>
Diffstat (limited to 'tests/i18n/test_extraction.py')
-rw-r--r--tests/i18n/test_extraction.py18
1 files changed, 12 insertions, 6 deletions
diff --git a/tests/i18n/test_extraction.py b/tests/i18n/test_extraction.py
index 18088e5e16..633184f7c5 100644
--- a/tests/i18n/test_extraction.py
+++ b/tests/i18n/test_extraction.py
@@ -21,6 +21,7 @@ from django.utils.translation import TranslatorCommentWarning
LOCALE = 'de'
has_xgettext = find_command('xgettext')
+
@skipUnless(has_xgettext, 'xgettext is mandatory for extraction tests')
class ExtractorTests(SimpleTestCase):
@@ -130,9 +131,10 @@ class BasicExtractorTests(ExtractorTests):
self.assertRaises(SyntaxError, management.call_command, 'makemessages', locale=LOCALE, extensions=['tpl'], verbosity=0)
with self.assertRaises(SyntaxError) as context_manager:
management.call_command('makemessages', locale=LOCALE, extensions=['tpl'], verbosity=0)
- six.assertRegex(self, str(context_manager.exception),
- r'Translation blocks must not include other block tags: blocktrans \(file templates[/\\]template_with_error\.tpl, line 3\)'
- )
+ six.assertRegex(
+ self, str(context_manager.exception),
+ r'Translation blocks must not include other block tags: blocktrans \(file templates[/\\]template_with_error\.tpl, line 3\)'
+ )
# Check that the temporary file was cleaned up
self.assertFalse(os.path.exists('./templates/template_with_error.tpl.py'))
@@ -210,13 +212,16 @@ class BasicExtractorTests(ExtractorTests):
self.assertEqual(len(ws), 3)
for w in ws:
self.assertTrue(issubclass(w.category, TranslatorCommentWarning))
- six.assertRegex(self, str(ws[0].message),
+ six.assertRegex(
+ self, str(ws[0].message),
r"The translator-targeted comment 'Translators: ignored i18n comment #1' \(file templates[/\\]comments.thtml, line 4\) was ignored, because it wasn't the last item on the line\."
)
- six.assertRegex(self, str(ws[1].message),
+ six.assertRegex(
+ self, str(ws[1].message),
r"The translator-targeted comment 'Translators: ignored i18n comment #3' \(file templates[/\\]comments.thtml, line 6\) was ignored, because it wasn't the last item on the line\."
)
- six.assertRegex(self, str(ws[2].message),
+ six.assertRegex(
+ self, str(ws[2].message),
r"The translator-targeted comment 'Translators: ignored i18n comment #4' \(file templates[/\\]comments.thtml, line 8\) was ignored, because it wasn't the last item on the line\."
)
# Now test .po file contents
@@ -281,6 +286,7 @@ class JavascriptExtractorTests(ExtractorTests):
self.assertMsgId("quz", po_contents)
self.assertMsgId("foobar", po_contents)
+
class IgnoredExtractorTests(ExtractorTests):
def test_ignore_option(self):