summaryrefslogtreecommitdiff
path: root/tests/template_tests/test_context.py
diff options
context:
space:
mode:
authorMarek WywiaƂ <onjinx@gmail.com>2014-02-16 14:50:27 +0100
committerBaptiste Mispelon <bmispelon@gmail.com>2014-02-16 15:18:45 +0100
commit8274fa60f88607eb0e81908f049c391455956dd8 (patch)
tree7405dd7591d3b710e19d758c153231e2063789a0 /tests/template_tests/test_context.py
parent57ba5bf97b13acdaccd6e091e6f23b619a6faedb (diff)
Made the new template.Context.flatten() method a public API.
That method was introduced in 9db4271bd11ac23a5a5652bbcdf8fb6d4b997651. Refs #21765.
Diffstat (limited to 'tests/template_tests/test_context.py')
-rw-r--r--tests/template_tests/test_context.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/template_tests/test_context.py b/tests/template_tests/test_context.py
index 64d0df8d10..dac74b36e3 100644
--- a/tests/template_tests/test_context.py
+++ b/tests/template_tests/test_context.py
@@ -50,6 +50,17 @@ class ContextTests(TestCase):
test_context['fruit']
self.assertIsNone(test_context.get('fruit'))
+ def test_flatten_context(self):
+ a = Context()
+ a.update({'a': 2})
+ a.update({'b': 4})
+ a.update({'c': 8})
+
+ self.assertEqual(a.flatten(), {
+ 'False': False, 'None': None, 'True': True,
+ 'a': 2, 'b': 4, 'c': 8
+ })
+
def test_context_comparable(self):
test_data = {'x': 'y', 'v': 'z', 'd': {'o': object, 'a': 'b'}}