Exemplo n.º 1
0
 def test_my_view(self):
     from myproject.views import my_view
     context = testing.DummyModel()
     request = testing.DummyRequest()
     renderer = testing.registerDummyRenderer('templates/mytemplate.pt')
     response = my_view(context, request)
     self.assertEqual(renderer.project, 'myproject')
Exemplo n.º 2
0
 def test_my_view(self):
     from myproject.views import my_view
     context = testing.DummyModel()
     request = testing.DummyRequest()
     renderer = testing.registerDummyRenderer('templates/mytemplate.pt')
     response = my_view(context, request)
     self.assertEqual(renderer.project, 'myproject')
Exemplo n.º 3
0
 def test_my_view(self):
     from myproject.views import my_view
     request = testing.DummyRequest()
     result = my_view(request)
     self.assertEqual(result.status, '200 OK')
     body = result.app_iter[0]
     self.assertTrue('Welcome to' in body)
     self.assertEqual(len(result.headerlist), 2)
     self.assertEqual(result.headerlist[0],
                      ('Content-Type', 'text/html; charset=UTF-8'))
     self.assertEqual(result.headerlist[1],
                      ('Content-Length', str(len(body))))
Exemplo n.º 4
0
 def test_my_view(self):
     from myproject.views import my_view
     request = testing.DummyRequest()
     result = my_view(request)
     self.assertEqual(result.status, '200 OK')
     body = result.app_iter[0]
     self.assertTrue('Welcome to' in body)
     self.assertEqual(len(result.headerlist), 2)
     self.assertEqual(result.headerlist[0],
                      ('Content-Type', 'text/html; charset=UTF-8'))
     self.assertEqual(result.headerlist[1], ('Content-Length',
                                             str(len(body))))
Exemplo n.º 5
0
 def test_my_view(self):
     from myproject.views import my_view
     request = testing.DummyRequest()
     info = my_view(request)
     self.assertEqual(info['project'], 'MyProject')
Exemplo n.º 6
0
 def test_my_view(self):
     from .views import my_view
     request = testing.DummyRequest()
     info = my_view(request)
     self.assertEqual(info['project'], 'MyProject')