diff --git a/tests/admin_custom_urls/tests.py b/tests/admin_custom_urls/tests.py index 2255ff59dc..eff23931ef 100644 --- a/tests/admin_custom_urls/tests.py +++ b/tests/admin_custom_urls/tests.py @@ -62,7 +62,6 @@ class AdminCustomUrlsTest(TestCase): string works. """ response = self.client.get(reverse('admin_custom_urls:admin_custom_urls_action_add'), {'name': 'My Action'}) - self.assertEqual(response.status_code, 200) self.assertContains(response, 'value="My Action"') def test_basic_add_POST(self): @@ -75,7 +74,6 @@ class AdminCustomUrlsTest(TestCase): "description": "Description of added action", } response = self.client.post(reverse('admin_custom_urls:admin_custom_urls_action_add'), post_data) - self.assertEqual(response.status_code, 200) self.assertContains(response, 'dismissAddRelatedObjectPopup') self.assertContains(response, 'Action added through a popup') @@ -88,7 +86,6 @@ class AdminCustomUrlsTest(TestCase): url = reverse('admin_custom_urls:%s_action_change' % Action._meta.app_label, args=(quote('add'),)) response = self.client.get(url) - self.assertEqual(response.status_code, 200) self.assertContains(response, 'Change action') # Should correctly get the change_view for the model instance with the @@ -96,7 +93,6 @@ class AdminCustomUrlsTest(TestCase): url = reverse('admin_custom_urls:%s_action_change' % Action._meta.app_label, args=(quote("path/to/html/document.html"),)) response = self.client.get(url) - self.assertEqual(response.status_code, 200) self.assertContains(response, 'Change action') self.assertContains(response, 'value="path/to/html/document.html"') diff --git a/tests/admin_inlines/tests.py b/tests/admin_inlines/tests.py index ea6dcbf517..4f2377b2de 100644 --- a/tests/admin_inlines/tests.py +++ b/tests/admin_inlines/tests.py @@ -492,7 +492,6 @@ class TestInlineProtectedOnDelete(TestDataMixin, TestCase): 'chapter_set-0-DELETE': 'on' } response = self.client.post(change_url, data) - self.assertEqual(response.status_code, 200) self.assertContains(response, "Deleting chapter %s would require deleting " "the following protected related objects: foot note %s" % (chapter, foot_note)) diff --git a/tests/admin_views/tests.py b/tests/admin_views/tests.py index 48182f2a4a..910d7ff32d 100644 --- a/tests/admin_views/tests.py +++ b/tests/admin_views/tests.py @@ -227,7 +227,6 @@ class AdminViewBasicTest(AdminViewBasicTestCase): def test_add_with_GET_args(self): response = self.client.get(reverse('admin:admin_views_section_add'), {'name': 'My Section'}) - self.assertEqual(response.status_code, 200) self.assertContains(response, 'value="My Section"', msg_prefix="Couldn't find an input with the right value in the response") @@ -292,7 +291,6 @@ class AdminViewBasicTest(AdminViewBasicTestCase): 'date_1': '14:55:39', } response = self.client.post(reverse('admin:admin_views_article_add'), post_data) - self.assertEqual(response.status_code, 200) self.assertContains(response, 'dismissAddRelatedObjectPopup') self.assertContains(response, 'title with a new\\u000Aline') @@ -512,7 +510,6 @@ class AdminViewBasicTest(AdminViewBasicTestCase): This also tests relation-spanning filters (e.g. 'color__value'). """ response = self.client.get(reverse('admin:admin_views_thing_changelist')) - self.assertEqual(response.status_code, 200) self.assertContains(response, '
Overridden help text for the date
') self.assertContains(response, '', html=True) self.assertNotContains(response, "Some help text for the date (with unicode ŠĐĆŽćžšđ)") @@ -5156,11 +5142,9 @@ class UserAdminTest(TestCase): def test_user_fk_add_popup(self): """User addition through a FK popup should return the appropriate JavaScript response.""" response = self.client.get(reverse('admin:admin_views_album_add')) - self.assertEqual(response.status_code, 200) self.assertContains(response, reverse('admin:auth_user_add')) self.assertContains(response, 'class="related-widget-wrapper-link add-related" id="add_id_owner"') response = self.client.get(reverse('admin:auth_user_add') + '?_popup=1') - self.assertEqual(response.status_code, 200) self.assertNotContains(response, 'name="_continue"') self.assertNotContains(response, 'name="_addanother"') data = { @@ -5171,19 +5155,16 @@ class UserAdminTest(TestCase): '_save': '1', } response = self.client.post(reverse('admin:auth_user_add') + '?_popup=1', data, follow=True) - self.assertEqual(response.status_code, 200) self.assertContains(response, 'dismissAddRelatedObjectPopup') def test_user_fk_change_popup(self): """User change through a FK popup should return the appropriate JavaScript response.""" response = self.client.get(reverse('admin:admin_views_album_add')) - self.assertEqual(response.status_code, 200) self.assertContains(response, reverse('admin:auth_user_change', args=('__fk__',))) self.assertContains(response, 'class="related-widget-wrapper-link change-related" id="change_id_owner"') user = User.objects.get(username='changeuser') url = reverse('admin:auth_user_change', args=(user.pk,)) + '?_popup=1' response = self.client.get(url) - self.assertEqual(response.status_code, 200) self.assertNotContains(response, 'name="_continue"') self.assertNotContains(response, 'name="_addanother"') data = { @@ -5198,13 +5179,11 @@ class UserAdminTest(TestCase): '_save': '1', } response = self.client.post(url, data, follow=True) - self.assertEqual(response.status_code, 200) self.assertContains(response, 'dismissChangeRelatedObjectPopup') def test_user_fk_delete_popup(self): """User deletion through a FK popup should return the appropriate JavaScript response.""" response = self.client.get(reverse('admin:admin_views_album_add')) - self.assertEqual(response.status_code, 200) self.assertContains(response, reverse('admin:auth_user_delete', args=('__fk__',))) self.assertContains(response, 'class="related-widget-wrapper-link change-related" id="change_id_owner"') user = User.objects.get(username='changeuser') @@ -5216,7 +5195,6 @@ class UserAdminTest(TestCase): '_popup': '1', } response = self.client.post(url, data, follow=True) - self.assertEqual(response.status_code, 200) self.assertContains(response, 'dismissDeleteRelatedObjectPopup') def test_save_add_another_button(self): @@ -5360,7 +5338,6 @@ class CSSTest(TestCase): Ensure app and model tag are correctly read by change_form template """ response = self.client.get(reverse('admin:admin_views_section_add')) - self.assertEqual(response.status_code, 200) self.assertContains(response, 'Isn't it flat!") def test_view_non_existent_flatpage(self): @@ -72,13 +71,11 @@ class FlatpageCSRFTests(TestCase): User.objects.create_user('testuser', 'test@example.com', 's3krit') self.client.login(username='testuser', password='s3krit') response = self.client.get('/flatpage_root/sekrit/') - self.assertEqual(response.status_code, 200) self.assertContains(response, "Isn't it sekrit!
") def test_fallback_flatpage(self): "A flatpage can be served by the fallback middleware" response = self.client.get('/flatpage/') - self.assertEqual(response.status_code, 200) self.assertContains(response, "Isn't it flat!
") def test_fallback_non_existent_flatpage(self): diff --git a/tests/flatpages_tests/test_middleware.py b/tests/flatpages_tests/test_middleware.py index c6b040775e..fd9bd11a5b 100644 --- a/tests/flatpages_tests/test_middleware.py +++ b/tests/flatpages_tests/test_middleware.py @@ -57,7 +57,6 @@ class FlatpageMiddlewareTests(TestDataMixin, TestCase): def test_view_flatpage(self): "A flatpage can be served through a view, even when the middleware is in use" response = self.client.get('/flatpage_root/flatpage/') - self.assertEqual(response.status_code, 200) self.assertContains(response, "Isn't it flat!
") def test_view_non_existent_flatpage(self): @@ -72,13 +71,11 @@ class FlatpageMiddlewareTests(TestDataMixin, TestCase): User.objects.create_user('testuser', 'test@example.com', 's3krit') self.client.login(username='testuser', password='s3krit') response = self.client.get('/flatpage_root/sekrit/') - self.assertEqual(response.status_code, 200) self.assertContains(response, "Isn't it sekrit!
") def test_fallback_flatpage(self): "A flatpage can be served by the fallback middleware" response = self.client.get('/flatpage/') - self.assertEqual(response.status_code, 200) self.assertContains(response, "Isn't it flat!
") def test_fallback_non_existent_flatpage(self): @@ -93,7 +90,6 @@ class FlatpageMiddlewareTests(TestDataMixin, TestCase): User.objects.create_user('testuser', 'test@example.com', 's3krit') self.client.login(username='testuser', password='s3krit') response = self.client.get('/sekrit/') - self.assertEqual(response.status_code, 200) self.assertContains(response, "Isn't it sekrit!
") def test_fallback_flatpage_special_chars(self): @@ -108,7 +104,6 @@ class FlatpageMiddlewareTests(TestDataMixin, TestCase): fp.sites.add(settings.SITE_ID) response = self.client.get('/some.very_special~chars-here/') - self.assertEqual(response.status_code, 200) self.assertContains(response, "Isn't it special!
") @@ -176,5 +171,4 @@ class FlatpageMiddlewareAppendSlashTests(TestDataMixin, TestCase): fp.sites.add(settings.SITE_ID) response = self.client.get('/') - self.assertEqual(response.status_code, 200) self.assertContains(response, "Root
") diff --git a/tests/flatpages_tests/test_views.py b/tests/flatpages_tests/test_views.py index 4e9e38768b..58dd2eb81e 100644 --- a/tests/flatpages_tests/test_views.py +++ b/tests/flatpages_tests/test_views.py @@ -57,7 +57,6 @@ class FlatpageViewTests(TestDataMixin, TestCase): def test_view_flatpage(self): "A flatpage can be served through a view" response = self.client.get('/flatpage_root/flatpage/') - self.assertEqual(response.status_code, 200) self.assertContains(response, "Isn't it flat!
") def test_view_non_existent_flatpage(self): @@ -72,7 +71,6 @@ class FlatpageViewTests(TestDataMixin, TestCase): User.objects.create_user('testuser', 'test@example.com', 's3krit') self.client.login(username='testuser', password='s3krit') response = self.client.get('/flatpage_root/sekrit/') - self.assertEqual(response.status_code, 200) self.assertContains(response, "Isn't it sekrit!
") def test_fallback_flatpage(self): @@ -97,7 +95,6 @@ class FlatpageViewTests(TestDataMixin, TestCase): fp.sites.add(settings.SITE_ID) response = self.client.get('/flatpage_root/some.very_special~chars-here/') - self.assertEqual(response.status_code, 200) self.assertContains(response, "Isn't it special!
") diff --git a/tests/generic_views/test_base.py b/tests/generic_views/test_base.py index 340d0a5f5f..6d5045a81b 100644 --- a/tests/generic_views/test_base.py +++ b/tests/generic_views/test_base.py @@ -247,7 +247,6 @@ class TemplateViewTest(SimpleTestCase): def _assert_about(self, response): response.render() - self.assertEqual(response.status_code, 200) self.assertContains(response, '