mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Fixes for permissions debug page, closes #2278
This commit is contained in:
parent
27409a7892
commit
26300738e3
3 changed files with 22 additions and 13 deletions
|
|
@ -378,6 +378,13 @@ async def test_permissions_debug(ds_client):
|
|||
cookie = ds_client.actor_cookie({"id": "root"})
|
||||
response = await ds_client.get("/-/permissions", cookies={"ds_actor": cookie})
|
||||
assert response.status_code == 200
|
||||
# Should have a select box listing permissions
|
||||
for fragment in (
|
||||
'<select name="permission" id="permission">',
|
||||
'<option value="view-instance">view-instance (default True)</option>',
|
||||
'<option value="insert-row">insert-row (default False)</option>',
|
||||
):
|
||||
assert fragment in response.text
|
||||
# Should show one failure and one success
|
||||
soup = Soup(response.text, "html.parser")
|
||||
check_divs = soup.findAll("div", {"class": "check"})
|
||||
|
|
@ -673,6 +680,7 @@ async def test_actor_restricted_permissions(
|
|||
"permission": permission,
|
||||
"resource": expected_resource,
|
||||
"result": expected_result,
|
||||
"default": perms_ds.permissions[permission].default,
|
||||
}
|
||||
assert response.json() == expected
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue