diff --git a/tests/webadmin/test_auth.py b/tests/webadmin/test_auth.py index 8ef1692..587d258 100644 --- a/tests/webadmin/test_auth.py +++ b/tests/webadmin/test_auth.py @@ -48,11 +48,11 @@ def test_index_redirects_to_login_when_anon(self, client): assert resp.status_code == 302 assert resp.location.endswith('/login') - def test_index_redirects_to_admin_for_admin(self, client): + def test_index_redirects_admin_to_the_same_page_as_owner(self, client): login_as(client, BOB_PORT1, BOB_PASS) resp = client.get('/') assert resp.status_code == 302 - assert '/admin/' in resp.location + assert resp.location.endswith('/me/'), resp.location def test_index_redirects_to_me_for_owner(self, client): login_as(client, ALICE_PORT1, ALICE_PASS) diff --git a/tests/webadmin/test_nav.py b/tests/webadmin/test_nav.py new file mode 100644 index 0000000..3615e00 --- /dev/null +++ b/tests/webadmin/test_nav.py @@ -0,0 +1,82 @@ +"""The main menu: the same tabs for everyone, extra ones for admins.""" +import re + +from _test_helpers import (ALICE_PASS, ALICE_PORT1, BOB_PASS, BOB_PORT1, + login_as) + +SHARED = ['Dashboard', 'Video', 'Logs'] +ADMIN_ONLY = ['All entries', 'Connections', 'Server'] + + +def _nav(html): + m = re.search(r'