summaryrefslogtreecommitdiff
path: root/tests/admin_docs
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_docs
parentc0c78f1b707f825eee974c65515a837f8cf46e66 (diff)
Fixed #23620 -- Used more specific assertions in the Django test suite.
Diffstat (limited to 'tests/admin_docs')
-rw-r--r--tests/admin_docs/tests.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/tests/admin_docs/tests.py b/tests/admin_docs/tests.py
index c410eff020..6234834955 100644
--- a/tests/admin_docs/tests.py
+++ b/tests/admin_docs/tests.py
@@ -130,38 +130,38 @@ class XViewMiddlewareTest(AdminDocsTestCase):
def test_xview_func(self):
user = User.objects.get(username='super')
response = self.client.head('/xview/func/')
- self.assertFalse('X-View' in response)
+ self.assertNotIn('X-View', response)
self.client.login(username='super', password='secret')
response = self.client.head('/xview/func/')
- self.assertTrue('X-View' in response)
+ self.assertIn('X-View', response)
self.assertEqual(response['X-View'], 'admin_docs.views.xview')
user.is_staff = False
user.save()
response = self.client.head('/xview/func/')
- self.assertFalse('X-View' in response)
+ self.assertNotIn('X-View', response)
user.is_staff = True
user.is_active = False
user.save()
response = self.client.head('/xview/func/')
- self.assertFalse('X-View' in response)
+ self.assertNotIn('X-View', response)
def test_xview_class(self):
user = User.objects.get(username='super')
response = self.client.head('/xview/class/')
- self.assertFalse('X-View' in response)
+ self.assertNotIn('X-View', response)
self.client.login(username='super', password='secret')
response = self.client.head('/xview/class/')
- self.assertTrue('X-View' in response)
+ self.assertIn('X-View', response)
self.assertEqual(response['X-View'], 'admin_docs.views.XViewClass')
user.is_staff = False
user.save()
response = self.client.head('/xview/class/')
- self.assertFalse('X-View' in response)
+ self.assertNotIn('X-View', response)
user.is_staff = True
user.is_active = False
user.save()
response = self.client.head('/xview/class/')
- self.assertFalse('X-View' in response)
+ self.assertNotIn('X-View', response)
@unittest.skipUnless(utils.docutils_is_available, "no docutils installed.")