MCPcopy
hub / github.com/django/django / test_context

Method test_context

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

Source from the content-addressed store, hash-verified

16
17class ContextTests(SimpleTestCase):
18 def test_context(self):
19 c = Context({"a": 1, "b": "xyzzy"})
20 self.assertEqual(c["a"], 1)
21 self.assertEqual(c.push(), {})
22 c["a"] = 2
23 self.assertEqual(c["a"], 2)
24 self.assertEqual(c.get("a"), 2)
25 self.assertEqual(c.pop(), {"a": 2})
26 self.assertEqual(c["a"], 1)
27 self.assertEqual(c.get("foo", 42), 42)
28 self.assertEqual(c, mock.ANY)
29
30 def test_push_context_manager(self):
31 c = Context({"a": 1})

Callers

nothing calls this directly

Calls 4

ContextClass · 0.90
pushMethod · 0.45
getMethod · 0.45
popMethod · 0.45

Tested by

no test coverage detected