mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
Fixed #27034 -- Made makemessages independent of USE_I18N
Thanks Tim Graham for the review.
This commit is contained in:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user