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