Test that a set can be passed as a value. Sets are often used in Django settings to ensure uniqueness, however, sets are unordered. The middleware ensures consistency via sorting if a set is passed.
(self)
| 64 | self.assertPolicyEqual(build_policy(policy), "default-src 'self' foo.com") |
| 65 | |
| 66 | def test_config_value_as_set(self): |
| 67 | """ |
| 68 | Test that a set can be passed as a value. |
| 69 | |
| 70 | Sets are often used in Django settings to ensure uniqueness, however, |
| 71 | sets are unordered. The middleware ensures consistency via sorting if a |
| 72 | set is passed. |
| 73 | """ |
| 74 | policy = {"default-src": {CSP.SELF, "foo.com", "bar.com"}} |
| 75 | self.assertPolicyEqual( |
| 76 | build_policy(policy), "default-src 'self' bar.com foo.com" |
| 77 | ) |
| 78 | |
| 79 | def test_config_value_none(self): |
| 80 | """ |
nothing calls this directly
no test coverage detected