From 456f9b98471e2aab71c6f58e3bf40a1026a3b466 Mon Sep 17 00:00:00 2001 From: Ramiro Morales Date: Mon, 21 Jan 2013 23:22:18 -0300 Subject: [PATCH] Simplified a i18n test. --- tests/regressiontests/i18n/commands/extraction.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/tests/regressiontests/i18n/commands/extraction.py b/tests/regressiontests/i18n/commands/extraction.py index 1d6a72d725..eeb2a9524b 100644 --- a/tests/regressiontests/i18n/commands/extraction.py +++ b/tests/regressiontests/i18n/commands/extraction.py @@ -109,14 +109,12 @@ class BasicExtractorTests(ExtractorTests): def test_extraction_error(self): os.chdir(self.test_dir) - shutil.copyfile('./templates/template_with_error.tpl', './templates/template_with_error.html') - self.assertRaises(SyntaxError, management.call_command, 'makemessages', locale=LOCALE, verbosity=0) + self.assertRaises(SyntaxError, management.call_command, 'makemessages', locale=LOCALE, extensions=['tpl'], verbosity=0) with self.assertRaises(SyntaxError) as context_manager: - management.call_command('makemessages', locale=LOCALE, verbosity=0) + management.call_command('makemessages', locale=LOCALE, extensions=['tpl'], verbosity=0) self.assertRegexpMatches(str(context_manager.exception), - r'Translation blocks must not include other block tags: blocktrans \(file templates[/\\]template_with_error\.html, line 3\)' + r'Translation blocks must not include other block tags: blocktrans \(file templates[/\\]template_with_error\.tpl, line 3\)' ) - os.remove('./templates/template_with_error.html') # Check that the temporary file was cleaned up self.assertFalse(os.path.exists('./templates/template_with_error.html.py'))