1
0
mirror of https://github.com/django/django.git synced 2025-11-07 07:15:35 +00:00

Made a bunch of simplifications now that we don't support Python 2.4

git-svn-id: http://code.djangoproject.com/svn/django/trunk@15933 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Adrian Holovaty
2011-03-28 02:27:43 +00:00
parent 579eb97961
commit 0fdabe885b
3 changed files with 18 additions and 37 deletions

View File

@@ -75,11 +75,10 @@ class BasicExtractorTests(ExtractorTests):
os.chdir(self.test_dir)
shutil.copyfile('./templates/template_with_error.txt', './templates/template_with_error.html')
self.assertRaises(SyntaxError, management.call_command, 'makemessages', locale=LOCALE, verbosity=0)
try: # TODO: Simplify this try/try block when we drop support for Python 2.4
try:
management.call_command('makemessages', locale=LOCALE, verbosity=0)
except SyntaxError, e:
self.assertEqual(str(e), 'Translation blocks must not include other block tags: blocktrans (file templates/template_with_error.html, line 3)')
try:
management.call_command('makemessages', locale=LOCALE, verbosity=0)
except SyntaxError, e:
self.assertEqual(str(e), 'Translation blocks must not include other block tags: blocktrans (file templates/template_with_error.html, line 3)')
finally:
os.remove('./templates/template_with_error.html')
os.remove('./templates/template_with_error.html.py') # Waiting for #8536 to be fixed