diff options
| author | Karen Tracey <kmtracey@gmail.com> | 2009-04-04 19:34:52 +0000 |
|---|---|---|
| committer | Karen Tracey <kmtracey@gmail.com> | 2009-04-04 19:34:52 +0000 |
| commit | 63143d5d9d4f0f4dc6a4948fca24d904e72f3d35 (patch) | |
| tree | 3137c70608fe1c77fbdee3b97fda565b7471004f /tests/regressiontests/templates/tests.py | |
| parent | 48e01d2b3db28be153feae7f3cecb09941a4e41b (diff) | |
Fixed the test added for #9005 to use the e.args[0] instead of e.message. Exceptions didn't have 'message' before Python 2.5, and it was deprecated as of Python 2.6. args[0] works without error or DeprecationWarning from Python 2.3 through 2.6.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10394 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests/regressiontests/templates/tests.py')
| -rw-r--r-- | tests/regressiontests/templates/tests.py | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/tests/regressiontests/templates/tests.py b/tests/regressiontests/templates/tests.py index 5eeaa5a430..4ccf9d0c47 100644 --- a/tests/regressiontests/templates/tests.py +++ b/tests/regressiontests/templates/tests.py @@ -154,24 +154,24 @@ class Templates(unittest.TestCase): self.assertEqual(split, ["sometag", '_("Page not found")', 'value|yesno:_("yes,no")']) def test_url_reverse_no_settings_module(self): - #Regression test for #9005 + # Regression test for #9005 from django.template import Template, Context, TemplateSyntaxError - + old_settings_module = settings.SETTINGS_MODULE old_template_debug = settings.TEMPLATE_DEBUG - + settings.SETTINGS_MODULE = None settings.TEMPLATE_DEBUG = True - + t = Template('{% url will_not_match %}') c = Context() try: rendered = t.render(c) except TemplateSyntaxError, e: - #Assert that we are getting the template syntax error and not the - #string encoding error. - self.assertEquals(e.message, "Caught an exception while rendering: Reverse for 'will_not_match' with arguments '()' and keyword arguments '{}' not found.") - + # Assert that we are getting the template syntax error and not the + # string encoding error. + self.assertEquals(e.args[0], "Caught an exception while rendering: Reverse for 'will_not_match' with arguments '()' and keyword arguments '{}' not found.") + settings.SETTINGS_MODULE = old_settings_module settings.TEMPLATE_DEBUG = old_template_debug @@ -931,7 +931,7 @@ class Templates(unittest.TestCase): 'widthratio08': ('{% widthratio %}', {}, template.TemplateSyntaxError), 'widthratio09': ('{% widthratio a b %}', {'a':50,'b':100}, template.TemplateSyntaxError), 'widthratio10': ('{% widthratio a b 100.0 %}', {'a':50,'b':100}, '50'), - + # #10043: widthratio should allow max_width to be a variable 'widthratio11': ('{% widthratio a b c %}', {'a':50,'b':100, 'c': 100}, '50'), |
