summaryrefslogtreecommitdiff
path: root/tests/middleware
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2021-04-23 08:59:35 -0400
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2021-04-30 12:32:52 +0200
commit54da6e2ac20bde80e0de9e35aa0c40ae1dd13943 (patch)
tree2c89d734b430d7f32381680601e8ef805b2c73fa /tests/middleware
parent8bcb00858e0ddec79cc96669c238d29c30d7effb (diff)
downloaddjango-54da6e2ac20bde80e0de9e35aa0c40ae1dd13943.tar.gz
Fixed #32678 -- Removed SECURE_BROWSER_XSS_FILTER setting.
Diffstat (limited to 'tests/middleware')
-rw-r--r--tests/middleware/test_security.py28
1 files changed, 0 insertions, 28 deletions
diff --git a/tests/middleware/test_security.py b/tests/middleware/test_security.py
index 1b7434c9a8..49432fbc8a 100644
--- a/tests/middleware/test_security.py
+++ b/tests/middleware/test_security.py
@@ -175,34 +175,6 @@ class SecurityMiddlewareTest(SimpleTestCase):
"""
self.assertNotIn('X-Content-Type-Options', self.process_response().headers)
- @override_settings(SECURE_BROWSER_XSS_FILTER=True)
- def test_xss_filter_on(self):
- """
- With SECURE_BROWSER_XSS_FILTER set to True, the middleware adds
- "s-xss-protection: 1; mode=block" header to the response.
- """
- self.assertEqual(
- self.process_response().headers['X-XSS-Protection'],
- '1; mode=block',
- )
-
- @override_settings(SECURE_BROWSER_XSS_FILTER=True)
- def test_xss_filter_already_present(self):
- """
- The middleware will not override an "X-XSS-Protection" header
- already present in the response.
- """
- response = self.process_response(secure=True, headers={"X-XSS-Protection": "foo"})
- self.assertEqual(response.headers["X-XSS-Protection"], "foo")
-
- @override_settings(SECURE_BROWSER_XSS_FILTER=False)
- def test_xss_filter_off(self):
- """
- With SECURE_BROWSER_XSS_FILTER set to False, the middleware does not
- add an "X-XSS-Protection" header to the response.
- """
- self.assertNotIn('X-XSS-Protection', self.process_response().headers)
-
@override_settings(SECURE_SSL_REDIRECT=True)
def test_ssl_redirect_on(self):
"""