self.assertEquals(pystache.Template('{{#foo}}{{thing1}} and {{thing2}} and {{outer_thing}}{{/foo}}{{^foo}}Not foo!{{/foo}}',view).render(),"one and foo and two")
deftest_looping_and_negation_context(self):
view=ComplexView()
self.assertEquals(pystache.Template('{{#item}}{{header}}: {{name}} {{/item}}{{^item}} Shouldnt see me{{/item}}',view).render(),"Colors: red Colors: green Colors: blue ")
deftest_empty_context(self):
view=ComplexView()
self.assertEquals(pystache.Template('{{#empty_list}}Shouldnt see me {{/empty_list}}{{^empty_list}}Should see me{{/empty_list}}',view).render(),"Should see me")
deftest_callables(self):
view=Lambdas()
self.assertEquals(pystache.Template('{{#replace_foo_with_bar}}foo != bar. oh, it does!{{/replace_foo_with_bar}}',view).render(),'bar != bar. oh, it does!')