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.

23 lines
565 B

import pytest
7 years ago
from pyramid.httpexceptions import HTTPFound
from pyramid.testing import DummyRequest
7 years ago
@pytest.mark.parametrize(
'user,location',
[(None, '/login'), ('someone', '/orders')]
)
def test_welcome(user, location):
7 years ago
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}'
7 years ago
def test_faq():
from ordr.views.pages import faq
result = faq(None, None)
assert result == {}