Exemple #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")
Exemple #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")
Exemple #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, '/')
Exemple #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')
Exemple #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, '/')
Exemple #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')