Commit 7e130676 by Chris Jerdonek

Added simpler test case for issue #53.

parent 7ccb55fd
...@@ -75,5 +75,20 @@ class TestPystache(unittest.TestCase): ...@@ -75,5 +75,20 @@ class TestPystache(unittest.TestCase):
ret = pystache.render(template, context) ret = pystache.render(template, context)
self.assertEquals(ret, """<ul><li>Chris</li><li>Tom</li><li>PJ</li></ul>""") self.assertEquals(ret, """<ul><li>Chris</li><li>Tom</li><li>PJ</li></ul>""")
def test_later_list_section_with_escapable_character(self):
"""
This is a simple test case intended to cover issue #53.
The incorrect result was the following, when markupsafe is available
(unnecessary escaping of the second section's contents)--
AssertionError: Markup(u'foo &lt;') != 'foo <'
"""
template = """{{#s1}}foo{{/s1}} {{#s2}}<{{/s2}}"""
context = {'s1': True, 's2': [True]}
actual = pystache.render(template, context)
self.assertEquals(actual, """foo <""")
if __name__ == '__main__': if __name__ == '__main__':
unittest.main() unittest.main()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment