MCPcopy
hub / github.com/django/django / test_setdefault

Method test_setdefault

tests/template_tests/test_context.py:92–101  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

90 )
91
92 def test_setdefault(self):
93 c = Context()
94
95 x = c.setdefault("x", 42)
96 self.assertEqual(x, 42)
97 self.assertEqual(c["x"], 42)
98
99 x = c.setdefault("x", 100)
100 self.assertEqual(x, 42)
101 self.assertEqual(c["x"], 42)
102
103 def test_resolve_on_context_method(self):
104 """

Callers

nothing calls this directly

Calls 2

ContextClass · 0.90
setdefaultMethod · 0.45

Tested by

no test coverage detected