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

        request = testing.DummyRequest()
        inst = TutorialViews(request)
        response = inst.hello()
        self.assertEqual('Hello View', response['name'])
예제 #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'])
예제 #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')
예제 #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')
예제 #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)
예제 #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')
예제 #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'])
예제 #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)
예제 #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'])
예제 #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')