def test_hierarchical_partials_with_lambdas(self): view = Lambdas() view.template = '{{>partial_with_partial_and_lambda}}' self.assertEquals(view.render(), 'nopqrstuvwxyznopqrstuvwxyz')
def test_higher_order_rot13(self): view = Lambdas() view.template = '{{#rot13}}abcdefghijklm{{/rot13}}' self.assertEquals(view.render(), 'nopqrstuvwxyz')
def test_higher_order_lambda(self): view = Lambdas() view.template = '{{#sort}}zyxwvutsrqponmlkjihgfedcba{{/sort}}' self.assertEquals(view.render(), 'abcdefghijklmnopqrstuvwxyz')
def test_higher_order_replace(self): view = Lambdas() self.assertEquals(view.render(), 'bar != bar. oh, it does!')
def test_callables(self): view = Lambdas() view.template = '{{#replace_foo_with_bar}}foo != bar. oh, it does!{{/replace_foo_with_bar}}' self.assertEquals(view.render(), 'bar != bar. oh, it does!')
def test_partials_with_lambda(self): view = Lambdas() view.template = "{{>partial_with_lambda}}" self.assertEquals(view.render(), "nopqrstuvwxyz")