def test_my_view(self): from tutorial.views import hello_world request = testing.DummyRequest() response = hello_world(request) self.assertEqual(response.status, '200 OK')
def test_hello(self): from tutorial.views import hello_world request = testing.DummyRequest() response = hello_world(request) self.assertEqual('Hello View', response['name'])
def test_my_view(self): from tutorial.views import hello_world request = testing.DummyRequest() response = hello_world(request) self.assertEqual(response['title'], 'Hello World')
def test_hello_content(self): from tutorial.views import hello_world request = testing.DummyRequest() response = hello_world(request) self.assertIn(b'Go back', response.body)
def test_hello(self): from tutorial.views import hello_world request = testing.DummyRequest() response = hello_world(request) self.assertEqual(response.status_code, 200)