def test_nested_context(self): renderer = Renderer() view = NestedContext(renderer) view.template = '{{#foo}}{{thing1}} and {{thing2}} and {{outer_thing}}{{/foo}}{{^foo}}Not foo!{{/foo}}' actual = renderer.render(view) self.assertString(actual, u"one and foo and two")
def test_nested_context_is_available_in_view(self): renderer = Renderer() view = NestedContext(renderer) view.template = "{{#herp}}{{#derp}}{{nested_context_in_view}}{{/derp}}{{/herp}}" actual = renderer.render(view) self.assertString(actual, u"it works!")
def test_nested_context_is_available_in_view(self): renderer = Renderer() view = NestedContext(renderer) view.template = '{{#herp}}{{#derp}}{{nested_context_in_view}}{{/derp}}{{/herp}}' actual = renderer.render(view) self.assertString(actual, u'it works!')
def test_nested_context_is_available_in_view(self): view = NestedContext() view.template = '{{#herp}}{{#derp}}{{nested_context_in_view}}{{/derp}}{{/herp}}' self.assertEquals(view.render(), 'it works!')
def test_nested_context(self): self.assertEquals(NestedContext().render(), "one and foo and two")
def test_nested_context_is_available_in_view(self): view = NestedContext() view.template = "{{#herp}}{{#derp}}{{nested_context_in_view}}{{/derp}}{{/herp}}" self.assertEquals(view.render(), "it works!")
def test_nested_context(self): view = NestedContext() view.template = '{{#foo}}{{thing1}} and {{thing2}} and {{outer_thing}}{{/foo}}{{^foo}}Not foo!{{/foo}}' self.assertEquals(view.render(), "one and foo and two")
def test_nested_context(self): view = NestedContext() self.assertEquals( pystache.Template( '{{#foo}}{{thing1}} and {{thing2}} and {{outer_thing}}{{/foo}}{{^foo}}Not foo!{{/foo}}', view).render(), "one and foo and two")
def test_nested_context(self): renderer = Renderer() actual = renderer.render(NestedContext(renderer)) self.assertString(actual, u"one and foo and two")