class Routes: """ Dict with all routes """ site_routes = { '/': index(), '/my_view': my_view(), }
def test_my_view(pyramid_req): from views import my_view response = my_view(pyramid_req) assert response['greeting'] == 'Hello world!'
def test_my_view(self): from views import my_view request = testing.DummyRequest() info = my_view(request) self.assertEqual(info['project'], 'whoWillWin')
def test_it(self): from views import my_view request = testing.DummyRequest() info = my_view(request) self.assertEqual(info['one'].name, 'one') self.assertEqual(info['project'], 'TestProject')