mirror of
https://github.com/django/django.git
synced 2025-08-04 19:08:28 +00:00
Fixed #27034 -- Made makemessages independent of USE_I18N
Thanks Tim Graham for the review.
This commit is contained in:
parent
324c1b432a
commit
5fb22b4d4c
5 changed files with 254 additions and 241 deletions
|
@ -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))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue