canaille-globuzma/tests/oidc/test_consent.py

17 lines
478 B
Python
Raw Normal View History

2020-09-17 10:01:21 +00:00
def test_no_logged_no_access(testclient):
testclient.get("/consent", status=403)
def test_consent_list(testclient, client, consent, logged_user, token):
2020-10-30 18:19:34 +00:00
res = testclient.get("/consent", status=200)
2022-10-17 15:49:52 +00:00
assert client.client_name in res.text
2020-09-17 10:01:21 +00:00
assert not token.revoked
2020-10-30 22:41:02 +00:00
res = testclient.get(f"/consent/delete/{consent.cn[0]}", status=302)
2020-09-17 10:01:21 +00:00
2020-10-30 22:41:02 +00:00
res = res.follow(status=200)
2022-10-17 15:49:52 +00:00
assert client.client_name not in res.text
2020-09-17 10:01:21 +00:00
token.reload()
2020-09-17 10:01:21 +00:00
assert token.revoked