import pytest from pyramid.httpexceptions import HTTPFound from pyramid.testing import DummyRequest @pytest.mark.parametrize( 'user,location', [(None, '/login'), ('someone', '/orders')] ) def test_welcome(user, location): from ordr.views.pages import welcome request = DummyRequest(user=user) result = welcome(None, request) assert isinstance(result, HTTPFound) assert result.location == f'http://example.com/{location}' def test_faq(): from ordr.views.pages import faq result = faq(None, None) assert result == {}