summaryrefslogtreecommitdiff
path: root/tests/csrf_tests/tests.py
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/csrf_tests/tests.py
parentc0c78f1b707f825eee974c65515a837f8cf46e66 (diff)
downloaddjango-f7969b0920c403118656f6bfec58d6454d79ef1a.tar.gz
Fixed #23620 -- Used more specific assertions in the Django test suite.
Diffstat (limited to 'tests/csrf_tests/tests.py')
-rw-r--r--tests/csrf_tests/tests.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/csrf_tests/tests.py b/tests/csrf_tests/tests.py
index b12e409955..ee19017515 100644
--- a/tests/csrf_tests/tests.py
+++ b/tests/csrf_tests/tests.py
@@ -119,7 +119,7 @@ class CsrfViewMiddlewareTest(TestCase):
self.assertEqual(csrf_cookie['secure'], True)
self.assertEqual(csrf_cookie['httponly'], True)
self.assertEqual(csrf_cookie['path'], '/test/')
- self.assertTrue('Cookie' in resp2.get('Vary', ''))
+ self.assertIn('Cookie', resp2.get('Vary', ''))
def test_process_response_get_token_not_used(self):
"""
@@ -340,7 +340,7 @@ class CsrfViewMiddlewareTest(TestCase):
req = self._get_GET_no_csrf_cookie_request()
resp = view(req)
self.assertTrue(resp.cookies.get(settings.CSRF_COOKIE_NAME, False))
- self.assertTrue('Cookie' in resp.get('Vary', ''))
+ self.assertIn('Cookie', resp.get('Vary', ''))
def test_ensures_csrf_cookie_with_middleware(self):
"""
@@ -357,7 +357,7 @@ class CsrfViewMiddlewareTest(TestCase):
resp = view(req)
resp2 = CsrfViewMiddleware().process_response(req, resp)
self.assertTrue(resp2.cookies.get(settings.CSRF_COOKIE_NAME, False))
- self.assertTrue('Cookie' in resp2.get('Vary', ''))
+ self.assertIn('Cookie', resp2.get('Vary', ''))
def test_ensures_csrf_cookie_no_logging(self):
"""