mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Run black formatter
This commit is contained in:
parent
b5f41772ca
commit
60a38cee85
14 changed files with 222 additions and 80 deletions
|
|
@ -358,18 +358,12 @@ async def test_root_with_root_enabled_gets_all_permissions(ds_client):
|
|||
|
||||
# Test instance-level permissions (no resource)
|
||||
assert (
|
||||
await ds_client.ds.allowed(action="permissions-debug", actor=root_actor)
|
||||
is True
|
||||
await ds_client.ds.allowed(action="permissions-debug", actor=root_actor) is True
|
||||
)
|
||||
assert await ds_client.ds.allowed(action="debug-menu", actor=root_actor) is True
|
||||
|
||||
# Test view permissions using the new ds.allowed() method
|
||||
assert (
|
||||
await ds_client.ds.allowed(
|
||||
action="view-instance", actor=root_actor
|
||||
)
|
||||
is True
|
||||
)
|
||||
assert await ds_client.ds.allowed(action="view-instance", actor=root_actor) is True
|
||||
|
||||
assert (
|
||||
await ds_client.ds.allowed(
|
||||
|
|
@ -462,10 +456,7 @@ async def test_root_without_root_enabled_no_special_permissions(ds_client):
|
|||
|
||||
# View permissions should still work (default=True)
|
||||
assert (
|
||||
await ds_client.ds.allowed(
|
||||
action="view-instance", actor=root_actor
|
||||
)
|
||||
is True
|
||||
await ds_client.ds.allowed(action="view-instance", actor=root_actor) is True
|
||||
) # Default permission
|
||||
|
||||
assert (
|
||||
|
|
@ -479,9 +470,7 @@ async def test_root_without_root_enabled_no_special_permissions(ds_client):
|
|||
|
||||
# But restricted permissions should NOT automatically be granted
|
||||
# Test with instance-level permission (no resource class)
|
||||
result = await ds_client.ds.allowed(
|
||||
action="permissions-debug", actor=root_actor
|
||||
)
|
||||
result = await ds_client.ds.allowed(action="permissions-debug", actor=root_actor)
|
||||
assert (
|
||||
result is not True
|
||||
), "Root without root_enabled should not automatically get permissions-debug"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue