Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

[1.0.X] Fixed the test added for #9005 to use the e.args[0] instead o…

…f 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
  • Loading branch information...
commit a9931e5655bcf792d436759017dad6544e3aeed2 1 parent 2d20e52
Karen Tracey authored April 04, 2009

Showing 1 changed file with 8 additions and 8 deletions. Show diff stats Hide diff stats

  1. 16  tests/regressiontests/templates/tests.py
16  tests/regressiontests/templates/tests.py
@@ -150,24 +150,24 @@ def test_token_smart_split(self):
150 150
         self.assertEqual(split, ["sometag", '_("Page not found")', 'value|yesno:_("yes,no")'])
151 151
 
152 152
     def test_url_reverse_no_settings_module(self):
153  
-        #Regression test for #9005
  153
+        # Regression test for #9005
154 154
         from django.template import Template, Context, TemplateSyntaxError
155  
-        
  155
+
156 156
         old_settings_module = settings.SETTINGS_MODULE
157 157
         old_template_debug = settings.TEMPLATE_DEBUG
158  
-        
  158
+
159 159
         settings.SETTINGS_MODULE = None
160 160
         settings.TEMPLATE_DEBUG = True
161  
-        
  161
+
162 162
         t = Template('{% url will_not_match %}')
163 163
         c = Context()
164 164
         try:
165 165
             rendered = t.render(c)
166 166
         except TemplateSyntaxError, e:
167  
-            #Assert that we are getting the template syntax error and not the
168  
-            #string encoding error.
169  
-            self.assertEquals(e.message, "Caught an exception while rendering: Reverse for 'will_not_match' with arguments '()' and keyword arguments '{}' not found.")
170  
-        
  167
+            # Assert that we are getting the template syntax error and not the
  168
+            # string encoding error.
  169
+            self.assertEquals(e.args[0], "Caught an exception while rendering: Reverse for 'will_not_match' with arguments '()' and keyword arguments '{}' not found.")
  170
+
171 171
         settings.SETTINGS_MODULE = old_settings_module
172 172
         settings.TEMPLATE_DEBUG = old_template_debug
173 173
 

0 notes on commit a9931e5

Please sign in to comment.
Something went wrong with that request. Please try again.