mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
check_visibility can now take multiple permissions into account
Closes #1829
This commit is contained in:
parent
6887c12ea3
commit
78dad236df
10 changed files with 196 additions and 82 deletions
|
|
@ -823,8 +823,14 @@ def test_hook_forbidden(restore_working_directory):
|
|||
assert 403 == response.status
|
||||
response2 = client.get("/data2")
|
||||
assert 302 == response2.status
|
||||
assert "/login?message=view-database" == response2.headers["Location"]
|
||||
assert "view-database" == client.ds._last_forbidden_message
|
||||
assert (
|
||||
response2.headers["Location"]
|
||||
== "/login?message=You do not have permission to view this database"
|
||||
)
|
||||
assert (
|
||||
client.ds._last_forbidden_message
|
||||
== "You do not have permission to view this database"
|
||||
)
|
||||
|
||||
|
||||
def test_hook_handle_exception(app_client):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue