summaryrefslogtreecommitdiff
path: root/tests/admin_views
diff options
context:
space:
mode:
authorBerker Peksag <berker.peksag@gmail.com>2014-10-28 12:02:56 +0200
committerTim Graham <timograham@gmail.com>2014-11-03 11:56:37 -0500
commitf7969b0920c403118656f6bfec58d6454d79ef1a (patch)
tree866df7de0524251323fef2b4262e672150d95f00 /tests/admin_views
parentc0c78f1b707f825eee974c65515a837f8cf46e66 (diff)
Fixed #23620 -- Used more specific assertions in the Django test suite.
Diffstat (limited to 'tests/admin_views')
-rw-r--r--tests/admin_views/tests.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/admin_views/tests.py b/tests/admin_views/tests.py
index 051fc0ae8d..562d7573e6 100644
--- a/tests/admin_views/tests.py
+++ b/tests/admin_views/tests.py
@@ -90,7 +90,7 @@ class AdminViewBasicTestCase(TestCase):
content.
"""
self.assertEqual(response.status_code, 200)
- self.assertTrue(response.content.index(force_bytes(text1)) < response.content.index(force_bytes(text2)),
+ self.assertLess(response.content.index(force_bytes(text1)), response.content.index(force_bytes(text2)),
failing_msg)
@@ -866,7 +866,7 @@ class AdminViewFormUrlTest(TestCase):
Tests whether change_view has form_url in response.context
"""
response = self.client.get('/test_admin/%s/admin_views/section/1/' % self.urlbit)
- self.assertTrue('form_url' in response.context, msg='form_url not present in response.context')
+ self.assertIn('form_url', response.context, msg='form_url not present in response.context')
self.assertEqual(response.context['form_url'], 'pony')
def test_initial_data_can_be_overridden(self):
@@ -4123,7 +4123,7 @@ class UserAdminTest(TestCase):
})
self.assertEqual(response.status_code, 200)
adminform = response.context['adminform']
- self.assertTrue('password' not in adminform.form.errors)
+ self.assertNotIn('password', adminform.form.errors)
self.assertEqual(adminform.form.errors['password2'],
["The two password fields didn't match."])
@@ -5040,7 +5040,7 @@ class AdminViewOnSiteTests(TestCase):
# just verifying the parent form failed validation, as expected --
# this isn't the regression test
- self.assertTrue('some_required_info' in response.context['adminform'].form.errors)
+ self.assertIn('some_required_info', response.context['adminform'].form.errors)
# actual regression test
for error_set in response.context['inline_admin_formset'].formset.errors:
@@ -5070,7 +5070,7 @@ class AdminViewOnSiteTests(TestCase):
# just verifying the parent form failed validation, as expected --
# this isn't the regression test
- self.assertTrue('some_required_info' in response.context['adminform'].form.errors)
+ self.assertIn('some_required_info', response.context['adminform'].form.errors)
# actual regression test
for error_set in response.context['inline_admin_formset'].formset.errors: