def test_hello(self):
        from tutorial.views import TutorialViews

        request = testing.DummyRequest()
        inst = TutorialViews(request)
        response = inst.hello()
        self.assertEqual('Hello View', response['name'])
Exemplo n.º 2
0
    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'])
Exemplo n.º 4
0
    def test_hello(self):
        from tutorial.views import TutorialViews

        request = testing.DummyRequest()
        inst = TutorialViews(request)
        response = inst.hello()

        self.assertEqual(response['name'], 'Hello View')
Exemplo n.º 5
0
    def test_home(self):
        from tutorial.views import TutorialViews

        request = testing.DummyRequest()
        inst = TutorialViews(request)
        response = inst.home()

        self.assertEqual(response.status, '302 Found')
Exemplo n.º 6
0
    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)
Exemplo n.º 7
0
    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')
Exemplo n.º 8
0
    def test_home(self):
        from tutorial.views import TutorialViews

        request = testing.DummyRequest()
        inst = TutorialViews(request)
        response = inst.home()

        self.assertEqual("Home view", response['name'])
Exemplo n.º 9
0
    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)
Exemplo n.º 10
0
    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'])
Exemplo n.º 12
0
    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')