diff --git a/examples/nested_context.mustache b/examples/nested_context.mustache index 0cf2418..b2f02a2 100644 --- a/examples/nested_context.mustache +++ b/examples/nested_context.mustache @@ -1 +1 @@ -{{#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}} diff --git a/examples/nested_context.py b/examples/nested_context.py index 62d2d51..2691802 100644 --- a/examples/nested_context.py +++ b/examples/nested_context.py @@ -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'} diff --git a/tests/test_examples.py b/tests/test_examples.py index af67735..9ad6c1e 100644 --- a/tests/test_examples.py +++ b/tests/test_examples.py @@ -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()