summaryrefslogtreecommitdiff
path: root/pystache/tests/test_renderengine.py
diff options
context:
space:
mode:
Diffstat (limited to 'pystache/tests/test_renderengine.py')
-rw-r--r--pystache/tests/test_renderengine.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/pystache/tests/test_renderengine.py b/pystache/tests/test_renderengine.py
index 3629708..6f4e767 100644
--- a/pystache/tests/test_renderengine.py
+++ b/pystache/tests/test_renderengine.py
@@ -529,6 +529,21 @@ class RenderTests(unittest.TestCase, AssertStringMixin, AssertExceptionMixin):
self._assert_render(u'<~bar~#bar#>', template, context)
+ def test_section__lambda__mixed_list(self):
+ """
+ Test a mixed list of lambdas and non-lambdas as a section value.
+
+ This test case is equivalent to a test submitted to the Mustache spec here:
+
+ https://github.com/mustache/spec/pull/47 .
+
+ """
+ template = '<{{#lambdas}}foo{{/lambdas}}>'
+ context = {'foo': 'bar',
+ 'lambdas': [lambda text: "~{{%s}}~" % text, 1]}
+
+ self._assert_render(u'<~bar~foo>', template, context)
+
def test_section__lambda__not_on_context_stack(self):
"""
Check that section lambdas are not pushed onto the context stack.