mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-03 17:49:27 +02:00
See #230: can now use "or" operator to check permissions
This commit is contained in:
parent
ed6c1a9a5b
commit
dfb4f5f62a
5 changed files with 50 additions and 7 deletions
|
@ -231,8 +231,9 @@ def authenticated_actor(factories, mocker):
|
|||
|
||||
@pytest.fixture
|
||||
def assert_user_permission():
|
||||
def inner(view, permissions):
|
||||
def inner(view, permissions, operator='and'):
|
||||
assert HasUserPermission in view.permission_classes
|
||||
assert getattr(view, 'permission_operator', 'and') == operator
|
||||
assert set(view.required_permissions) == set(permissions)
|
||||
return inner
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue