With SECURE_CROSS_ORIGIN_OPENER_POLICY set to a valid value, the middleware adds a "Cross-Origin_Opener-Policy" header to the response.
(self)
| 282 | ) |
| 283 | |
| 284 | def test_coop_on(self): |
| 285 | """ |
| 286 | With SECURE_CROSS_ORIGIN_OPENER_POLICY set to a valid value, the |
| 287 | middleware adds a "Cross-Origin_Opener-Policy" header to the response. |
| 288 | """ |
| 289 | tests = ["same-origin", "same-origin-allow-popups", "unsafe-none"] |
| 290 | for value in tests: |
| 291 | with ( |
| 292 | self.subTest(value=value), |
| 293 | override_settings( |
| 294 | SECURE_CROSS_ORIGIN_OPENER_POLICY=value, |
| 295 | ), |
| 296 | ): |
| 297 | self.assertEqual( |
| 298 | self.process_response().headers["Cross-Origin-Opener-Policy"], |
| 299 | value, |
| 300 | ) |
| 301 | |
| 302 | @override_settings(SECURE_CROSS_ORIGIN_OPENER_POLICY="unsafe-none") |
| 303 | def test_coop_already_present(self): |
nothing calls this directly
no test coverage detected