mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Update tests to use new allowed() method instead of permission_allowed()
This commit is contained in:
parent
387afb0f69
commit
7aaff5e3d2
5 changed files with 211 additions and 6 deletions
|
|
@ -357,10 +357,10 @@ async def test_root_with_root_enabled_gets_all_permissions(ds_client):
|
|||
|
||||
# Test instance-level permissions (no resource)
|
||||
assert (
|
||||
await ds_client.ds.permission_allowed(root_actor, "permissions-debug", None)
|
||||
await ds_client.ds.allowed(action="permissions-debug", actor=root_actor)
|
||||
is True
|
||||
)
|
||||
assert await ds_client.ds.permission_allowed(root_actor, "debug-menu", None) 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 (
|
||||
|
|
@ -478,8 +478,8 @@ 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.permission_allowed(
|
||||
root_actor, "permissions-debug", None
|
||||
result = await ds_client.ds.allowed(
|
||||
action="permissions-debug", actor=root_actor
|
||||
)
|
||||
assert (
|
||||
result is not True
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue