diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2009-04-20 08:37:57 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2009-04-20 08:37:57 -0400 |
commit | c05bb65048278484b59bc71f28feb846748db746 (patch) | |
tree | 935c96f60a8b3f41c115a6a94d2193eaf3adafdb /test/test_templite.py | |
parent | 921add5fecbeaf18f649f7c21c26d0e0b4f8e1a7 (diff) | |
download | python-coveragepy-git-c05bb65048278484b59bc71f28feb846748db746.tar.gz |
Variables' items (dict access) can be used in templates.
Diffstat (limited to 'test/test_templite.py')
-rw-r--r-- | test/test_templite.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/test/test_templite.py b/test/test_templite.py index 15055f2e..fd7a3393 100644 --- a/test/test_templite.py +++ b/test/test_templite.py @@ -66,6 +66,11 @@ class TemplateTest(unittest.TestCase): obj.txt = "Once" self.try_render("{{obj.ditto}}", locals(), "OnceOnce") + def test_item_access(self): + # Variables' items can be used. + d = {'a':17, 'b':23} + self.try_render("{{d.a}} < {{d.b}}", locals(), "17 < 23") + def test_loops(self): # Loops work like in Django. nums = [1,2,3,4] |