mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
debug-menu permission, closes #1068
Also added tests for navigation menu logic.
This commit is contained in:
parent
9f0987cb57
commit
222f79bb4c
6 changed files with 58 additions and 4 deletions
|
|
@ -310,10 +310,11 @@ def test_permissions_checked(app_client, path, permissions):
|
|||
|
||||
def test_permissions_debug(app_client):
|
||||
app_client.ds._permission_checks.clear()
|
||||
assert 403 == app_client.get("/-/permissions").status
|
||||
assert app_client.get("/-/permissions").status == 403
|
||||
# With the cookie it should work
|
||||
cookie = app_client.actor_cookie({"id": "root"})
|
||||
response = app_client.get("/-/permissions", cookies={"ds_actor": cookie})
|
||||
assert response.status == 200
|
||||
# Should show one failure and one success
|
||||
soup = Soup(response.body, "html.parser")
|
||||
check_divs = soup.findAll("div", {"class": "check"})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue