Beispiel #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!")
Beispiel #2
0
 def test_basic(self):
     view = Simple("Hi {{thing}}!", { 'thing': 'world' })
     self.assertEquals(view.render(), "Hi world!")
Beispiel #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!")
Beispiel #4
0
 def test_non_callable_attributes(self):
     view = Simple()
     view.thing = 'Chris'
     self.assertEquals(view.render(), "Hi Chris!")
Beispiel #5
0
 def test_basic_method_calls(self):
     view = Simple()
     self.assertEquals(view.render(), "Hi pizza!")
Beispiel #6
0
 def test_template_load(self):
     view = Simple(thing='world')
     self.assertEquals(view.render(), "Hi world!")
Beispiel #7
0
 def test_kwargs(self):
     view = Simple("Hi {{thing}}!", thing='world')
     self.assertEquals(view.render(), "Hi world!")