From f7969b0920c403118656f6bfec58d6454d79ef1a Mon Sep 17 00:00:00 2001 From: Berker Peksag Date: Tue, 28 Oct 2014 12:02:56 +0200 Subject: Fixed #23620 -- Used more specific assertions in the Django test suite. --- tests/admin_docs/tests.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'tests/admin_docs') 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.") -- cgit v1.3