def test_hello(self): from tutorial.views import TutorialViews request = testing.DummyRequest() inst = TutorialViews(request) response = inst.hello() self.assertEqual('Hello View', response['name'])
def test_plain_without_name(self): from tutorial.views import TutorialViews request = testing.DummyRequest() inst = TutorialViews(request) response = inst.plain() self.assertIn(b'No Name Provided', response.body)
def test_home(self): from tutorial.views import TutorialViews request = testing.DummyRequest() inst = TutorialViews(request) response = inst.home() # Our view now returns data self.assertEqual('Home View', response['name'])
def test_hello(self): from tutorial.views import TutorialViews request = testing.DummyRequest() inst = TutorialViews(request) response = inst.hello() self.assertEqual(response['name'], 'Hello View')
def test_home(self): from tutorial.views import TutorialViews request = testing.DummyRequest() inst = TutorialViews(request) response = inst.home() self.assertEqual(response.status, '302 Found')
def test_plain_with_name(self): from tutorial.views import TutorialViews request = testing.DummyRequest() request.GET['name'] = 'Anderson Marques' inst = TutorialViews(request) response = inst.plain() self.assertIn(b'Anderson Marques', response.body)
def test_home(self): from tutorial.views import TutorialViews request = testing.DummyRequest() inst = TutorialViews(request) response = inst.home() # Our view now returns data self.assertEqual(response.status, '302 Found')
def test_home(self): from tutorial.views import TutorialViews request = testing.DummyRequest() inst = TutorialViews(request) response = inst.home() self.assertEqual("Home view", response['name'])
def test_hello(self): from tutorial.views import TutorialViews request = testing.DummyRequest() request.GET['name'] = 'John Doe' inst = TutorialViews(request) response = inst.plain() self.assertIn(b'John Doe', response.body)
def test_home(self): from tutorial.views import TutorialViews request = testing.DummyRequest() request.matchdict['first'] = 'First' request.matchdict['last'] = 'Last' inst = TutorialViews(request) response = inst.home() self.assertEqual(response['first'], 'First') self.assertEqual(response['last'], 'Last')
def test_home(self): from tutorial.views import TutorialViews request = testing.DummyRequest() request.matchdict['first'] = 'Anderson' request.matchdict['last'] = 'Marques' inst = TutorialViews(request) response = inst.home() self.assertEqual('Anderson', response['first']) self.assertEqual('Marques', response['last'])