MCPcopy
hub / github.com/django/django / test_config_value_none

Method test_config_value_none

tests/utils_tests/test_csp.py:79–87  ·  view source on GitHub ↗

Test that `None` removes the directive from the policy. Useful in cases where the CSP config is scripted in some way or explicitly not wanting to set a directive.

(self)

Source from the content-addressed store, hash-verified

77 )
78
79 def test_config_value_none(self):
80 """
81 Test that `None` removes the directive from the policy.
82
83 Useful in cases where the CSP config is scripted in some way or
84 explicitly not wanting to set a directive.
85 """
86 policy = {"default-src": [CSP.SELF], "script-src": None}
87 self.assertPolicyEqual(build_policy(policy), basic_policy)
88
89 def test_config_value_boolean_true(self):
90 policy = {"default-src": [CSP.SELF], "block-all-mixed-content": True}

Callers

nothing calls this directly

Calls 2

assertPolicyEqualMethod · 0.95
build_policyFunction · 0.90

Tested by

no test coverage detected