MCPcopy
hub / github.com/django/django / test_contextlist_get

Method test_contextlist_get

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

Source from the content-addressed store, hash-verified

873 )
874
875 def test_contextlist_get(self):
876 c1 = Context({"hello": "world", "goodbye": "john"})
877 c2 = Context({"goodbye": "world", "python": "rocks"})
878 k = ContextList([c1, c2])
879 self.assertEqual(k.get("hello"), "world")
880 self.assertEqual(k.get("goodbye"), "john")
881 self.assertEqual(k.get("python"), "rocks")
882 self.assertEqual(k.get("nonexistent", "default"), "default")
883
884 def test_15368(self):
885 # Need to insert a context processor that assumes certain things about

Callers

nothing calls this directly

Calls 3

getMethod · 0.95
ContextClass · 0.90
ContextListClass · 0.90

Tested by

no test coverage detected