test for demoting super admin
This commit is contained in:
parent
95f0ff3563
commit
d0f093ac16
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue
Block a user