summaryrefslogtreecommitdiff
path: root/tests/modeltests/test_client/models.py
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2010-12-04 07:28:12 +0000
committerAlex Gaynor <alex.gaynor@gmail.com>2010-12-04 07:28:12 +0000
commit5bc0ec4ec4b7c888a291bc81b2edd72812231d96 (patch)
treebf3bec9ab44f1847ed2076167039e763011ea1cd /tests/modeltests/test_client/models.py
parent6770c3626271569da41053c1cfd37f7128f1457f (diff)
Removed all usages of deprecated TestCase methods (self.fail*). This removed most of the Warnings emitted (with -Wall) during the test suite.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14803 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests/modeltests/test_client/models.py')
-rw-r--r--tests/modeltests/test_client/models.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/tests/modeltests/test_client/models.py b/tests/modeltests/test_client/models.py
index 59814a9bf1..426cc77686 100644
--- a/tests/modeltests/test_client/models.py
+++ b/tests/modeltests/test_client/models.py
@@ -73,7 +73,7 @@ class ClientTest(TestCase):
self.assertEqual(response.status_code, 200)
self.assertEqual(response.context['data'], '37')
self.assertEqual(response.templates[0].name, 'POST Template')
- self.failUnless('Data received' in response.content)
+ self.assertTrue('Data received' in response.content)
def test_response_headers(self):
"Check the value of HTTP headers returned in a response"
@@ -278,7 +278,7 @@ class ClientTest(TestCase):
# Log in
login = self.client.login(username='testclient', password='password')
- self.failUnless(login, 'Could not log in')
+ self.assertTrue(login, 'Could not log in')
# Request a page that requires a login
response = self.client.get('/test_client/login_protected_view/')
@@ -294,7 +294,7 @@ class ClientTest(TestCase):
# Log in
login = self.client.login(username='testclient', password='password')
- self.failUnless(login, 'Could not log in')
+ self.assertTrue(login, 'Could not log in')
# Request a page that requires a login
response = self.client.get('/test_client/login_protected_method_view/')
@@ -310,7 +310,7 @@ class ClientTest(TestCase):
# Log in
login = self.client.login(username='testclient', password='password')
- self.failUnless(login, 'Could not log in')
+ self.assertTrue(login, 'Could not log in')
# Request a page that requires a login
response = self.client.get('/test_client/login_protected_view_custom_redirect/')
@@ -321,13 +321,13 @@ class ClientTest(TestCase):
"Request a page that is protected with @login, but use bad credentials"
login = self.client.login(username='otheruser', password='nopassword')
- self.failIf(login)
+ self.assertFalse(login)
def test_view_with_inactive_login(self):
"Request a page that is protected with @login, but use an inactive login"
login = self.client.login(username='inactive', password='password')
- self.failIf(login)
+ self.assertFalse(login)
def test_logout(self):
"Request a logout after logging in"
@@ -355,7 +355,7 @@ class ClientTest(TestCase):
# Log in
login = self.client.login(username='testclient', password='password')
- self.failUnless(login, 'Could not log in')
+ self.assertTrue(login, 'Could not log in')
# Log in with wrong permissions. Should result in 302.
response = self.client.get('/test_client/permission_protected_view/')
@@ -372,7 +372,7 @@ class ClientTest(TestCase):
# Log in
login = self.client.login(username='testclient', password='password')
- self.failUnless(login, 'Could not log in')
+ self.assertTrue(login, 'Could not log in')
# Log in with wrong permissions. Should result in 302.
response = self.client.get('/test_client/permission_protected_method_view/')