1
0
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:
Julien Phalip
2011-11-11 13:07:14 +00:00
parent 9d410ee64b
commit c3df840c20
5 changed files with 46 additions and 12 deletions

View File

@@ -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)