mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
Fixed #16903 -- Added --no-location option to the makemessages command to not write '#: filename:line' comment lines in language files. Thanks to alpar for the suggestion and patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17081 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -214,3 +214,20 @@ class NoWrapExtractorTests(ExtractorTests):
|
||||
self.assertTrue(os.path.exists(self.PO_FILE))
|
||||
po_contents = open(self.PO_FILE, 'r').read()
|
||||
self.assertMsgId('""\n"This literal should also be included wrapped or not wrapped depending on the "\n"use of the --no-wrap option."', po_contents, use_quotes=False)
|
||||
|
||||
|
||||
class NoLocationExtractorTests(ExtractorTests):
|
||||
|
||||
def test_no_location_enabled(self):
|
||||
os.chdir(self.test_dir)
|
||||
management.call_command('makemessages', locale=LOCALE, verbosity=0, no_location=True)
|
||||
self.assertTrue(os.path.exists(self.PO_FILE))
|
||||
po_contents = open(self.PO_FILE, 'r').read()
|
||||
self.assertFalse('#: templates/test.html:55' in po_contents)
|
||||
|
||||
def test_no_location_disabled(self):
|
||||
os.chdir(self.test_dir)
|
||||
management.call_command('makemessages', locale=LOCALE, verbosity=0, no_location=False)
|
||||
self.assertTrue(os.path.exists(self.PO_FILE))
|
||||
po_contents = open(self.PO_FILE, 'r').read()
|
||||
self.assertTrue('#: templates/test.html:55' in po_contents)
|
||||
|
||||
Reference in New Issue
Block a user