With SECURE_HSTS_SECONDS non-zero and SECURE_HSTS_PRELOAD True, the middleware adds a "Strict-Transport-Security" header with the "preload" directive to the response.
(self)
| 111 | |
| 112 | @override_settings(SECURE_HSTS_SECONDS=10886400, SECURE_HSTS_PRELOAD=True) |
| 113 | def test_sts_preload(self): |
| 114 | """ |
| 115 | With SECURE_HSTS_SECONDS non-zero and SECURE_HSTS_PRELOAD True, the |
| 116 | middleware adds a "Strict-Transport-Security" header with the "preload" |
| 117 | directive to the response. |
| 118 | """ |
| 119 | response = self.process_response(secure=True) |
| 120 | self.assertEqual( |
| 121 | response.headers["Strict-Transport-Security"], |
| 122 | "max-age=10886400; preload", |
| 123 | ) |
| 124 | |
| 125 | @override_settings( |
| 126 | SECURE_HSTS_SECONDS=10886400, |
nothing calls this directly
no test coverage detected