mirror of
https://github.com/kennethreitz-archive/pystache.git
synced 2026-06-05 23:40:16 +00:00
Contexts still can't see outer scope. Add failing test.
This commit is contained in:
@@ -1 +1 @@
|
||||
{{#foo}}{{thing1}} and {{thing2}}{{/foo}}{{^foo}}Not foo!{{/foo}}
|
||||
{{#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()
|
||||
|
||||
Reference in New Issue
Block a user