diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/i18n/test_extraction.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/i18n/test_extraction.py b/tests/i18n/test_extraction.py index 6312456e50..3433c1944b 100644 --- a/tests/i18n/test_extraction.py +++ b/tests/i18n/test_extraction.py @@ -135,6 +135,19 @@ class ExtractorTests(POFileAssertionMixin, RunInTmpDirMixin, SimpleTestCase): class BasicExtractorTests(ExtractorTests): + @override_settings(USE_I18N=False) + def test_use_i18n_false(self): + """ + makemessages also runs successfully when USE_I18N is False. + """ + management.call_command('makemessages', locale=[LOCALE], verbosity=0) + self.assertTrue(os.path.exists(self.PO_FILE)) + with io.open(self.PO_FILE, 'r', encoding='utf-8') as fp: + po_contents = fp.read() + # Check two random strings + self.assertIn('#. Translators: One-line translator comment #1', po_contents) + self.assertIn('msgctxt "Special trans context #1"', po_contents) + def test_comments_extractor(self): management.call_command('makemessages', locale=[LOCALE], verbosity=0) self.assertTrue(os.path.exists(self.PO_FILE)) |
