MCPcopy
hub / github.com/django/django / test_sts_on

Method test_sts_on

tests/middleware/test_security.py:46–54  ·  view source on GitHub ↗

With SECURE_HSTS_SECONDS=3600, the middleware adds "Strict-Transport-Security: max-age=3600" to the response.

(self)

Source from the content-addressed store, hash-verified

44
45 @override_settings(SECURE_HSTS_SECONDS=3600)
46 def test_sts_on(self):
47 """
48 With SECURE_HSTS_SECONDS=3600, the middleware adds
49 "Strict-Transport-Security: max-age=3600" to the response.
50 """
51 self.assertEqual(
52 self.process_response(secure=True).headers["Strict-Transport-Security"],
53 "max-age=3600",
54 )
55
56 @override_settings(SECURE_HSTS_SECONDS=3600)
57 def test_sts_already_present(self):

Callers

nothing calls this directly

Calls 1

process_responseMethod · 0.95

Tested by

no test coverage detected