Permalink
Browse files

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

  • Loading branch information...
1 parent 5cd466a commit 152c4e025f5dd21194e5c80da49fd6ca46718dde @defunkt defunkt committed May 14, 2010
Showing with 5 additions and 2 deletions.
  1. +1 −1 examples/nested_context.mustache
  2. +3 −0 examples/nested_context.py
  3. +1 −1 tests/test_examples.py
View
2 examples/nested_context.mustache
@@ -1 +1 @@
-{{#foo}}{{thing1}} and {{thing2}}{{/foo}}{{^foo}}Not foo!{{/foo}}
+{{#foo}}{{thing1}} and {{thing2}} and {{outer_thing}}{{/foo}}{{^foo}}Not foo!{{/foo}}
View
3 examples/nested_context.py
@@ -3,5 +3,8 @@
class NestedContext(pystache.View):
template_path = 'examples'
+ def outer_thing(self):
+ return "two"
+
def foo(self):
return {'thing1': 'one', 'thing2': 'foo'}
View
2 tests/test_examples.py
@@ -69,7 +69,7 @@ def test_delimiters(self):
""")
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()

0 comments on commit 152c4e0

Please sign in to comment.