Commit 152c4e02 by Chris Wanstrath

Contexts still can't see outer scope. Add failing test.

parent 5cd466a6
{{#foo}}{{thing1}} and {{thing2}}{{/foo}}{{^foo}}Not foo!{{/foo}}
\ No newline at end of file
{{#foo}}{{thing1}} and {{thing2}} and {{outer_thing}}{{/foo}}{{^foo}}Not foo!{{/foo}}
......@@ -3,5 +3,8 @@ import pystache
class NestedContext(pystache.View):
template_path = 'examples'
def outer_thing(self):
return "two"
def foo(self):
return {'thing1': 'one', 'thing2': 'foo'}
......@@ -69,7 +69,7 @@ Again, Welcome!
""")
def test_nested_context(self):
self.assertEquals(NestedContext().render(), "one and foo")
self.assertEquals(NestedContext().render(), "one and foo and two")
if __name__ == '__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