MCPcopy
hub / github.com/django/django / test_render_context

Method test_render_context

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

Source from the content-addressed store, hash-verified

118 )
119
120 def test_render_context(self):
121 test_context = RenderContext({"fruit": "papaya"})
122
123 # push() limits access to the topmost dict
124 test_context.push()
125
126 test_context["vegetable"] = "artichoke"
127 self.assertEqual(list(test_context), ["vegetable"])
128
129 self.assertNotIn("fruit", test_context)
130 with self.assertRaises(KeyError):
131 test_context["fruit"]
132 self.assertIsNone(test_context.get("fruit"))
133
134 def test_flatten_context(self):
135 a = Context()

Callers

nothing calls this directly

Calls 3

getMethod · 0.95
RenderContextClass · 0.90
pushMethod · 0.45

Tested by

no test coverage detected