|
|
@ -3,6 +3,19 @@ |
|
|
|
from . import testapp |
|
|
|
from . import testapp |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_layout_unauthenticated_user(testapp): |
|
|
|
|
|
|
|
''' test the layout template elements for unauthenticated users |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The '/faq' path is used; '/' will redirect on authenticated users |
|
|
|
|
|
|
|
''' |
|
|
|
|
|
|
|
testapp.reset() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
response = testapp.get('/faq') |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assert '<!-- No logged in user -->' in response |
|
|
|
|
|
|
|
assert 'class="login-form' in response |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_page_welcome_unauthenticated(testapp): |
|
|
|
def test_page_welcome_unauthenticated(testapp): |
|
|
|
''' test the welcome page for a unauthenticated user ''' |
|
|
|
''' test the welcome page for a unauthenticated user ''' |
|
|
|
testapp.reset() |
|
|
|
testapp.reset() |
|
|
@ -11,7 +24,6 @@ def test_page_welcome_unauthenticated(testapp): |
|
|
|
|
|
|
|
|
|
|
|
# basic content test |
|
|
|
# basic content test |
|
|
|
assert 'Ordr | Welcome' in response |
|
|
|
assert 'Ordr | Welcome' in response |
|
|
|
assert '<!-- No logged in user -->' in response |
|
|
|
|
|
|
|
# test that no sections are highlightet |
|
|
|
# test that no sections are highlightet |
|
|
|
assert '<li class="nav-item active">' not in response |
|
|
|
assert '<li class="nav-item active">' not in response |
|
|
|
|
|
|
|
|
|
|
@ -24,7 +36,6 @@ def test_faq_unauthenticated(testapp): |
|
|
|
|
|
|
|
|
|
|
|
# basic content test |
|
|
|
# basic content test |
|
|
|
assert 'Ordr | FAQ' in response |
|
|
|
assert 'Ordr | FAQ' in response |
|
|
|
assert '<!-- No logged in user -->' in response |
|
|
|
|
|
|
|
# test the main nav section links and highlighting |
|
|
|
# test the main nav section links and highlighting |
|
|
|
li_one, li_two = response.html.find_all('li', class_='nav-item') |
|
|
|
li_one, li_two = response.html.find_all('li', class_='nav-item') |
|
|
|
assert 'active' in li_one['class'] |
|
|
|
assert 'active' in li_one['class'] |
|
|
|