See #230: can now use "or" operator to check permissions

This commit is contained in:
Eliot Berriot 2018-05-24 22:38:26 +02:00
parent ed6c1a9a5b
commit dfb4f5f62a
No known key found for this signature in database
GPG key ID: DD6965E2476E5C27
5 changed files with 50 additions and 7 deletions

View file

@ -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