Exemplo n.º 1
0
 def test_kwarg_renderer(self):
     """
     Renderers passed into the constructor override renderers defined on the
     class.
     """
     view = BasicView(html=lambda m: "inherited")
     result = view.render({}, 'text/html')
     self.assertEquals(result['body'], "inherited")
Exemplo n.º 2
0
 def test_kwarg_renderer(self):
     """
     Renderers passed into the constructor override renderers defined on the
     class.
     """
     view = BasicView(html=lambda m: "inherited")
     result = view.render({}, 'text/html')
     self.assertEquals(result['body'], "inherited")
Exemplo n.º 3
0
 def test_redirection(self):
     view = BasicView(html=Redirection('/'))
     result = view.render({}, 'text/html')
     self.assertEquals(type(result['body']), Redirection)
     self.assertEquals(result['body'].path, '/')
Exemplo n.º 4
0
 def test_redirection_lambda(self):
     view = BasicView(html=lambda m: Redirection(m))
     result = view.render('res', 'text/html')
     self.assertEquals(type(result['body']), Redirection)
     self.assertEquals(result['body'].path, 'res')
Exemplo n.º 5
0
 def test_redirection(self):
     view = BasicView(html=Redirection('/'))
     result = view.render({}, 'text/html')
     self.assertEquals(type(result['body']), Redirection)
     self.assertEquals(result['body'].path, '/')
Exemplo n.º 6
0
 def test_redirection_lambda(self):
     view = BasicView(html=lambda m: Redirection(m))
     result = view.render('res', 'text/html')
     self.assertEquals(type(result['body']), Redirection)
     self.assertEquals(result['body'].path, 'res')