MCPcopy
hub / github.com/django/django / test_sts_off

Method test_sts_off

tests/middleware/test_security.py:79–87  ·  view source on GitHub ↗

With SECURE_HSTS_SECONDS=0, the middleware does not add a "Strict-Transport-Security" header to the response.

(self)

Source from the content-addressed store, hash-verified

77
78 @override_settings(SECURE_HSTS_SECONDS=0)
79 def test_sts_off(self):
80 """
81 With SECURE_HSTS_SECONDS=0, the middleware does not add a
82 "Strict-Transport-Security" header to the response.
83 """
84 self.assertNotIn(
85 "Strict-Transport-Security",
86 self.process_response(secure=True).headers,
87 )
88
89 @override_settings(SECURE_HSTS_SECONDS=600, SECURE_HSTS_INCLUDE_SUBDOMAINS=True)
90 def test_sts_include_subdomains(self):

Callers

nothing calls this directly

Calls 1

process_responseMethod · 0.95

Tested by

no test coverage detected