summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Jerdonek <chris.jerdonek@gmail.com>2012-04-29 12:24:14 -0700
committerChris Jerdonek <chris.jerdonek@gmail.com>2012-04-29 12:24:14 -0700
commit9da8d1814a202a2f52b21c7771c12ba50b76a6d2 (patch)
treef3262cf71a76395f82675781bb5527bc7cc7f372
parent54eb4b5047bc75a596c9734f460726aa462aea2e (diff)
downloadpystache-9da8d1814a202a2f52b21c7771c12ba50b76a6d2.tar.gz
Added failing test case for issue #114.
-rw-r--r--pystache/tests/test_renderengine.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/pystache/tests/test_renderengine.py b/pystache/tests/test_renderengine.py
index cd8b191..667fa03 100644
--- a/pystache/tests/test_renderengine.py
+++ b/pystache/tests/test_renderengine.py
@@ -501,6 +501,22 @@ class RenderTests(unittest.TestCase, AssertStringMixin):
context = {'person': 'Mom', 'test': (lambda text: text + " :)")}
self._assert_render(u'Hi Mom :)', template, context)
+ def test_section__lambda__list(self):
+ """
+ Check that lists of lambdas are processed correctly for sections.
+
+ 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,
+ lambda text: "#{{%s}}#" % text]}
+
+ self._assert_render(u'<~bar~#bar#>', template, context)
+
def test_section__lambda__not_on_context_stack(self):
"""
Check that section lambdas are not pushed onto the context stack.