''' tests for the common layout and simple (static)''' from . import testapp # tests for layout template 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 '' in response assert 'id="login-form' in response def test_layout_authenticated_user(testapp): ''' test the layout template elements for unauthenticated users The '/faq' path is used; '/' will redirect on authenticated users ''' testapp.reset() testapp.login('user') response = testapp.get('/faq') assert '' in response assert 'id="login-form"' not in response assert 'Admin' not in response assert 'Logged in as TerryGilliam' in response def test_layout_authenticated_admin(testapp): ''' test the layout template elements for unauthenticated users The '/faq' path is used; '/' will redirect on authenticated users ''' testapp.reset() testapp.login('admin') response = testapp.get('/faq') assert '' in response assert 'id="login-form"' not in response assert 'Admin' in response assert 'Logged in as TerryJones' in response # tests for simple pages def test_page_welcome_unauthenticated(testapp): ''' test the welcome page for a unauthenticated user ''' testapp.reset() response = testapp.get('/') # basic content test assert 'Ordr | Welcome' in response # test that no sections are highlightet assert '