mirror of
https://github.com/simonw/datasette.git
synced 2026-10-06 08:37:00 +02:00
Accept numeric permission booleans
This commit is contained in:
parent
55de054fae
commit
c81d001d0c
2 changed files with 18 additions and 0 deletions
|
|
@ -457,6 +457,20 @@ async def test_permissions_debug(ds_client, filter_):
|
|||
assert checks == expected_checks
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
@pytest.mark.parametrize(
|
||||
"permissions_debug,expected_status",
|
||||
(
|
||||
(1, 200),
|
||||
(0, 403),
|
||||
),
|
||||
)
|
||||
async def test_permissions_debug_numeric_boolean(permissions_debug, expected_status):
|
||||
ds = Datasette(config={"permissions": {"permissions-debug": permissions_debug}})
|
||||
response = await ds.client.get("/-/permissions")
|
||||
assert response.status_code == expected_status
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
@pytest.mark.parametrize(
|
||||
"actor,allow,expected_fragment",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue