MCPcopy
hub / github.com/django/django / test_contextlist_keys

Method test_contextlist_keys

tests/test_client_regress/tests.py:860–873  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

858 response.context["does-not-exist"]
859
860 def test_contextlist_keys(self):
861 c1 = Context()
862 c1.update({"hello": "world", "goodbye": "john"})
863 c1.update({"hello": "dolly", "dolly": "parton"})
864 c2 = Context()
865 c2.update({"goodbye": "world", "python": "rocks"})
866 c2.update({"goodbye": "dolly"})
867
868 k = ContextList([c1, c2])
869 # None, True and False are builtins of BaseContext, and present
870 # in every Context without needing to be added.
871 self.assertEqual(
872 {"None", "True", "False", "hello", "goodbye", "python", "dolly"}, k.keys()
873 )
874
875 def test_contextlist_get(self):
876 c1 = Context({"hello": "world", "goodbye": "john"})

Callers

nothing calls this directly

Calls 4

updateMethod · 0.95
keysMethod · 0.95
ContextClass · 0.90
ContextListClass · 0.90

Tested by

no test coverage detected