Exemple #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')
Exemple #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')
Exemple #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))))
Exemple #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))))
Exemple #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')
Exemple #6
0
 def test_my_view(self):
     from .views import my_view
     request = testing.DummyRequest()
     info = my_view(request)
     self.assertEqual(info['project'], 'MyProject')