diff options
| author | Karen Tracey <kmtracey@gmail.com> | 2009-04-04 19:48:26 +0000 |
|---|---|---|
| committer | Karen Tracey <kmtracey@gmail.com> | 2009-04-04 19:48:26 +0000 |
| commit | a9931e5655bcf792d436759017dad6544e3aeed2 (patch) | |
| tree | 7dec72ddccb21e34c5a588c2f4d1b5bef7cffe62 | |
| parent | 2d20e5265a9cfcca82eee4e2a7f2afac15bd1641 (diff) | |
[1.0.X] 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.
r10394 from trunk.
git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@10395 bcc190cf-cafb-0310-a4f2-bffc1f526a37
| -rw-r--r-- | tests/regressiontests/templates/tests.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/tests/regressiontests/templates/tests.py b/tests/regressiontests/templates/tests.py index a1d69052ee..aecf94d461 100644 --- a/tests/regressiontests/templates/tests.py +++ b/tests/regressiontests/templates/tests.py @@ -150,24 +150,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 |
