MCPcopy
hub / github.com/django/django / assertPolicyEqual

Method assertPolicyEqual

tests/utils_tests/test_csp.py:32–35  ·  view source on GitHub ↗
(self, a, b)

Source from the content-addressed store, hash-verified

30class CSPBuildPolicyTest(SimpleTestCase):
31
32 def assertPolicyEqual(self, a, b):
33 parts_a = sorted(a.split("; ")) if a is not None else None
34 parts_b = sorted(b.split("; ")) if b is not None else None
35 self.assertEqual(parts_a, parts_b, f"Policies not equal: {a!r} != {b!r}")
36
37 def test_config_empty(self):
38 self.assertPolicyEqual(build_policy({}), "")

Calls 1

splitMethod · 0.45

Tested by

no test coverage detected