diff options
Diffstat (limited to 'tests/regressiontests')
| -rw-r--r-- | tests/regressiontests/i18n/commands/extraction.py | 17 | ||||
| -rw-r--r-- | tests/regressiontests/i18n/tests.py | 3 |
2 files changed, 19 insertions, 1 deletions
diff --git a/tests/regressiontests/i18n/commands/extraction.py b/tests/regressiontests/i18n/commands/extraction.py index c49577221e..fb612a3a42 100644 --- a/tests/regressiontests/i18n/commands/extraction.py +++ b/tests/regressiontests/i18n/commands/extraction.py @@ -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) diff --git a/tests/regressiontests/i18n/tests.py b/tests/regressiontests/i18n/tests.py index 17395ffb24..cefb6b1819 100644 --- a/tests/regressiontests/i18n/tests.py +++ b/tests/regressiontests/i18n/tests.py @@ -28,7 +28,8 @@ from .commands.tests import can_run_extraction_tests, can_run_compilation_tests if can_run_extraction_tests: from .commands.extraction import (ExtractorTests, BasicExtractorTests, JavascriptExtractorTests, IgnoredExtractorTests, SymlinkExtractorTests, - CopyPluralFormsExtractorTests, NoWrapExtractorTests) + CopyPluralFormsExtractorTests, NoWrapExtractorTests, + NoLocationExtractorTests) if can_run_compilation_tests: from .commands.compilation import MessageCompilationTests, PoFileTests from .contenttypes.tests import ContentTypeTests |
