CPI Ordering System (the old version)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
 
 
 
 
 

22 lines
565 B

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 == {}