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.

25 lines
784 B

7 years ago
''' functional tests for ordr2.views.pages '''
from . import testapp # noqa: F401
7 years ago
def test_welcome(testapp): # noqa: F811
7 years ago
result = testapp.get('/')
active = result.html.find('li', class_='active')
assert active.a['href'] == '/'
expected = {'/', '/faq', '/register', '/forgot', '/register'}
hrefs = {a['href'] for a in result.html.find_all('a')}
assert expected == hrefs
forms = result.html.find_all('form')
assert len(forms) == 1
login_form = forms[0]
assert login_form['action'] == '/login'
assert login_form['method'] == 'POST'
assert 'wrong username' not in result
7 years ago
def test_faq(testapp): # noqa: F811
7 years ago
result = testapp.get('/faq')
active = result.html.find('li', class_='active')
assert active.a['href'] == '/faq'