Ejemplo n.º 1
0
 def test_template_load_from_multiple_path(self):
     view = Simple(thing='world')
     view.template_path = [
         os.path.join(view.template_path, 'nowhere'),
         view.template_path
         ]
     self.assertEquals(view.render(), "Hi world!")
Ejemplo n.º 2
0
 def test_basic(self):
     view = Simple("Hi {{thing}}!", { 'thing': 'world' })
     self.assertEquals(view.render(), "Hi world!")
Ejemplo n.º 3
0
 def test_view_instances_as_attributes(self):
     other = Simple(name='chris')
     other.template = '{{name}}'
     view = Simple()
     view.thing = other
     self.assertEquals(view.render(), "Hi chris!")
Ejemplo n.º 4
0
 def test_non_callable_attributes(self):
     view = Simple()
     view.thing = 'Chris'
     self.assertEquals(view.render(), "Hi Chris!")
Ejemplo n.º 5
0
 def test_basic_method_calls(self):
     view = Simple()
     self.assertEquals(view.render(), "Hi pizza!")
Ejemplo n.º 6
0
 def test_template_load(self):
     view = Simple(thing='world')
     self.assertEquals(view.render(), "Hi world!")
Ejemplo n.º 7
0
 def test_kwargs(self):
     view = Simple("Hi {{thing}}!", thing='world')
     self.assertEquals(view.render(), "Hi world!")