diff options
| author | Claude Paroz <claude@2xlibre.net> | 2016-08-08 15:46:52 +0200 |
|---|---|---|
| committer | Claude Paroz <claude@2xlibre.net> | 2016-08-11 21:16:19 +0200 |
| commit | 5fb22b4d4c664e14b7734550afc258ae97a4f8be (patch) | |
| tree | cb406be8657b0d8e838a8cd4d5778932059e9a0f /tests | |
| parent | 324c1b432a2fa07c8f911f8b923ed04be32c52c7 (diff) | |
Fixed #27034 -- Made makemessages independent of USE_I18N
Thanks Tim Graham for the review.
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)) |
