Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[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
@kmtracey kmtracey authored
Showing with 5 additions and 5 deletions.
  1. +5 −5 django/contrib/auth/tests/views.py
View
10 django/contrib/auth/tests/views.py
@@ -182,7 +182,7 @@ def test_current_site_in_context_after_login(self):
site = Site.objects.get_current()
self.assertEquals(response.context['site'], site)
self.assertEquals(response.context['site_name'], site.name)
- self.assert_(isinstance(response.context['form'], AuthenticationForm),
+ self.assert_(isinstance(response.context['form'], AuthenticationForm),
'Login form is not an AuthenticationForm')
def test_security_check(self, password='password'):
@@ -205,7 +205,7 @@ def test_security_check(self, password='password'):
}
)
self.assertEquals(response.status_code, 302)
- self.assertFalse(bad_url in response['Location'], "%s should be blocked" % bad_url)
+ self.failIf(bad_url in response['Location'], "%s should be blocked" % bad_url)
# Now, these URLs have an other URL as a GET parameter and therefore
# should be allowed
@@ -222,9 +222,9 @@ def test_security_check(self, password='password'):
}
)
self.assertEquals(response.status_code, 302)
- self.assertTrue('/view/?param=%s' % url_ in response['Location'], "/view/?param=%s should be allowed" % url_)
+ self.failUnless('/view/?param=%s' % url_ in response['Location'], "/view/?param=%s should be allowed" % url_)
+
-
class LogoutTest(AuthViewsTestCase):
urls = 'django.contrib.auth.tests.urls'
@@ -249,7 +249,7 @@ def test_logout_default(self):
self.assert_('Logged out' in response.content)
self.confirm_logged_out()
- def test_logout_with_next_page_specified(self):
+ def test_logout_with_next_page_specified(self):
"Logout with next_page option given redirects to specified resource"
self.login()
response = self.client.get('/logout/next_page/')
Please sign in to comment.
Something went wrong with that request. Please try again.