diff options
| author | Russell Keith-Magee <russell@keith-magee.com> | 2011-03-03 15:04:39 +0000 |
|---|---|---|
| committer | Russell Keith-Magee <russell@keith-magee.com> | 2011-03-03 15:04:39 +0000 |
| commit | afd040d4d3a06fe92e3080870b2ff2095ce86a75 (patch) | |
| tree | bda969614999a3fcfbf1466caa0d75e512dd1374 /tests/modeltests/test_client | |
| parent | b7c41c1fbb2d45634dde5f7a450ba1a5aea5a8af (diff) | |
Updated test assertions that have been deprecated by the move to unittest2. In summary, this means:
assert_ -> assertTrue
assertEquals -> assertEqual
failUnless -> assertTrue
For full details, see http://www.voidspace.org.uk/python/articles/unittest2.shtml#deprecations
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15728 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests/modeltests/test_client')
| -rw-r--r-- | tests/modeltests/test_client/models.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/modeltests/test_client/models.py b/tests/modeltests/test_client/models.py index 0960929004..16bdd2d29a 100644 --- a/tests/modeltests/test_client/models.py +++ b/tests/modeltests/test_client/models.py @@ -79,7 +79,7 @@ class ClientTest(TestCase): "Check the value of HTTP headers returned in a response" response = self.client.get("/test_client/header_view/") - self.assertEquals(response['X-DJANGO-TEST'], 'Slartibartfast') + self.assertEqual(response['X-DJANGO-TEST'], 'Slartibartfast') def test_raw_post(self): "POST raw data (with a content type) to a view" @@ -140,7 +140,7 @@ class ClientTest(TestCase): "A URL that redirects can be followed to termination." response = self.client.get('/test_client/double_redirect_view/', follow=True) self.assertRedirects(response, 'http://testserver/test_client/get_view/', status_code=302, target_status_code=200) - self.assertEquals(len(response.redirect_chain), 2) + self.assertEqual(len(response.redirect_chain), 2) def test_redirect_http(self): "GET a URL that redirects to an http URI" @@ -400,7 +400,7 @@ class ClientTest(TestCase): response = self.client.post('/test_client/session_view/') # Check that the session was modified - self.assertEquals(self.client.session['tobacconist'], 'hovercraft') + self.assertEqual(self.client.session['tobacconist'], 'hovercraft') def test_view_with_exception(self): "Request a page that is known to throw an error" |
