Example #1
0
 def test_hierarchical_partials_with_lambdas(self):
     view = Lambdas()
     view.template = '{{>partial_with_partial_and_lambda}}'
     self.assertEquals(view.render(), 'nopqrstuvwxyznopqrstuvwxyz')
Example #2
0
 def test_higher_order_rot13(self):
     view = Lambdas()
     view.template = '{{#rot13}}abcdefghijklm{{/rot13}}'
     self.assertEquals(view.render(), 'nopqrstuvwxyz')
Example #3
0
 def test_higher_order_lambda(self):
     view = Lambdas()
     view.template = '{{#sort}}zyxwvutsrqponmlkjihgfedcba{{/sort}}'
     self.assertEquals(view.render(), 'abcdefghijklmnopqrstuvwxyz')
Example #4
0
 def test_hierarchical_partials_with_lambdas(self):
     view = Lambdas()
     view.template = '{{>partial_with_partial_and_lambda}}'
     self.assertEquals(view.render(), 'nopqrstuvwxyznopqrstuvwxyz')
Example #5
0
 def test_higher_order_replace(self):
     view = Lambdas()
     self.assertEquals(view.render(),
                       'bar != bar. oh, it does!')
Example #6
0
 def test_higher_order_lambda(self):
     view = Lambdas()
     view.template = '{{#sort}}zyxwvutsrqponmlkjihgfedcba{{/sort}}'
     self.assertEquals(view.render(), 'abcdefghijklmnopqrstuvwxyz')
Example #7
0
 def test_higher_order_rot13(self):
     view = Lambdas()
     view.template = '{{#rot13}}abcdefghijklm{{/rot13}}'
     self.assertEquals(view.render(), 'nopqrstuvwxyz')
Example #8
0
 def test_higher_order_replace(self):
     view = Lambdas()
     self.assertEquals(view.render(), 'bar != bar. oh, it does!')
Example #9
0
 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!')
Example #10
0
 def test_partials_with_lambda(self):
     view = Lambdas()
     view.template = "{{>partial_with_lambda}}"
     self.assertEquals(view.render(), "nopqrstuvwxyz")