Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

[1.1.X] Made Python 2.3 compatibility fixes for some recent test addi…

…tions.

git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.1.X@12678 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 1fedc0b9ebf8694036581cc4a75601c89a50c727 1 parent cc65ac9
Karen Tracey authored

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

  1. 10  django/contrib/auth/tests/views.py
10  django/contrib/auth/tests/views.py
@@ -182,7 +182,7 @@ def test_current_site_in_context_after_login(self):
182 182
         site = Site.objects.get_current()
183 183
         self.assertEquals(response.context['site'], site)
184 184
         self.assertEquals(response.context['site_name'], site.name)
185  
-        self.assert_(isinstance(response.context['form'], AuthenticationForm), 
  185
+        self.assert_(isinstance(response.context['form'], AuthenticationForm),
186 186
                      'Login form is not an AuthenticationForm')
187 187
 
188 188
     def test_security_check(self, password='password'):
@@ -205,7 +205,7 @@ def test_security_check(self, password='password'):
205 205
                 }
206 206
             )
207 207
             self.assertEquals(response.status_code, 302)
208  
-            self.assertFalse(bad_url in response['Location'], "%s should be blocked" % bad_url)
  208
+            self.failIf(bad_url in response['Location'], "%s should be blocked" % bad_url)
209 209
 
210 210
         # Now, these URLs have an other URL as a GET parameter and therefore
211 211
         # should be allowed
@@ -222,9 +222,9 @@ def test_security_check(self, password='password'):
222 222
                 }
223 223
             )
224 224
             self.assertEquals(response.status_code, 302)
225  
-            self.assertTrue('/view/?param=%s' % url_ in response['Location'], "/view/?param=%s should be allowed" % url_)
  225
+            self.failUnless('/view/?param=%s' % url_ in response['Location'], "/view/?param=%s should be allowed" % url_)
  226
+
226 227
 
227  
-        
228 228
 class LogoutTest(AuthViewsTestCase):
229 229
     urls = 'django.contrib.auth.tests.urls'
230 230
 
@@ -249,7 +249,7 @@ def test_logout_default(self):
249 249
         self.assert_('Logged out' in response.content)
250 250
         self.confirm_logged_out()
251 251
 
252  
-    def test_logout_with_next_page_specified(self): 
  252
+    def test_logout_with_next_page_specified(self):
253 253
         "Logout with next_page option given redirects to specified resource"
254 254
         self.login()
255 255
         response = self.client.get('/logout/next_page/')

0 notes on commit 1fedc0b

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