1
0
mirror of https://github.com/django/django.git synced 2025-10-26 07:06:08 +00:00

Fixed #18479 -- Stopped makemessages raising error on gettext warnings

Thanks Niels Busch for the initial patch.
This commit is contained in:
Claude Paroz
2012-07-18 18:34:13 +02:00
parent d8e221db90
commit c54905b359
3 changed files with 54 additions and 24 deletions

View File

@@ -117,6 +117,14 @@ class BasicExtractorTests(ExtractorTests):
# Check that the temporary file was cleaned up
self.assertFalse(os.path.exists('./templates/template_with_error.html.py'))
def test_extraction_warning(self):
os.chdir(self.test_dir)
shutil.copyfile('./code.sample', './code_sample.py')
stdout = StringIO()
management.call_command('makemessages', locale=LOCALE, stdout=stdout)
os.remove('./code_sample.py')
self.assertIn("code_sample.py:4", stdout.getvalue())
def test_template_message_context_extractor(self):
"""
Ensure that message contexts are correctly extracted for the