Beispiel #1
0
class Routes:
    """
    Dict with all routes
    """
    site_routes = {
        '/': index(),
        '/my_view': my_view(),
    }
Beispiel #2
0
def test_my_view(pyramid_req):
    from views import my_view
    response = my_view(pyramid_req)
    assert response['greeting'] == 'Hello world!'
Beispiel #3
0
 def test_my_view(self):
     from views import my_view
     request = testing.DummyRequest()
     info = my_view(request)
     self.assertEqual(info['project'], 'whoWillWin')
Beispiel #4
0
 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')