test for demoting super admin

blueprint_refactoring
Simon Pirkelmann 2022-01-31 23:06:38 +01:00
parent 95f0ff3563
commit d0f093ac16
1 changed files with 10 additions and 1 deletions

View File

@ -304,9 +304,18 @@ def test_demote_user(temp_admin, client_authenticated):
response = client_authenticated.get(
f"/demote_admin/{temp_admin['username']}",
follow_redirects=True)
assert f"Benutzer {temp_admin['username']} ist bereits kein Admin!"
assert f"Benutzer {temp_admin['username']} ist bereits kein Admin!" \
in response.data.decode()
assert not user.has_role('admin')
# try removing admin permissions from superadmin
response = client_authenticated.get(
f"/demote_admin/gandalf",
follow_redirects=True)
assert "hat Super-Admin-Rechte und kann nicht verändert werden!" \
in response.data.decode()
def test_list_tokens(client_authenticated):
response = client_authenticated.get(f"/tokens", follow_redirects=True)