2020-08-26 14:27:08 +00:00
|
|
|
def test_no_logged_no_access(testclient):
|
2020-08-26 15:23:53 +00:00
|
|
|
testclient.get("/admin/authorization", status=403)
|
2020-08-26 14:27:08 +00:00
|
|
|
|
|
|
|
|
|
|
|
def test_no_admin_no_access(testclient, logged_user):
|
2020-08-26 15:23:53 +00:00
|
|
|
testclient.get("/admin/authorization", status=403)
|
2020-08-26 14:27:08 +00:00
|
|
|
|
|
|
|
|
|
|
|
def test_authorizaton_list(testclient, authorization, logged_admin):
|
2020-08-26 15:23:53 +00:00
|
|
|
res = testclient.get("/admin/authorization")
|
2022-01-11 16:57:58 +00:00
|
|
|
assert authorization.code in res.text
|
2020-08-26 14:27:08 +00:00
|
|
|
|
|
|
|
|
|
|
|
def test_authorizaton_view(testclient, authorization, logged_admin):
|
2022-01-11 16:57:58 +00:00
|
|
|
res = testclient.get("/admin/authorization/" + authorization.code)
|
2020-08-26 14:27:08 +00:00
|
|
|
for attr in authorization.may + authorization.must:
|
|
|
|
assert attr in res.text
|