|
|
@ -1,10 +1,21 @@ |
|
|
|
''' functional tests for ordr2.views.pages ''' |
|
|
|
''' functional tests for ordr2.views.pages ''' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import pytest |
|
|
|
|
|
|
|
|
|
|
|
from . import testapp # noqa: F401 |
|
|
|
from . import testapp # noqa: F401 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@pytest.mark.xfail |
|
|
|
def test_welcome(testapp): # noqa: F811 |
|
|
|
def test_welcome(testapp): # noqa: F811 |
|
|
|
|
|
|
|
testapp.logout() |
|
|
|
result = testapp.get('/') |
|
|
|
result = testapp.get('/') |
|
|
|
|
|
|
|
assert result.location == 'http://localhost/login' |
|
|
|
|
|
|
|
testapp.login('user', 'password') |
|
|
|
|
|
|
|
assert result.location == 'http://localhost/orders' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_login_get(testapp): # noqa: F811 |
|
|
|
|
|
|
|
result = testapp.get('/login') |
|
|
|
active = result.html.find('li', class_='active') |
|
|
|
active = result.html.find('li', class_='active') |
|
|
|
assert active.a['href'] == '/' |
|
|
|
assert active.a['href'] == '/' |
|
|
|
expected = {'/', '/faq', '/register', '/forgot', '/register'} |
|
|
|
expected = {'/', '/faq', '/register', '/forgot', '/register'} |
|
|
|