Skip to content

Commit

Permalink
test(access): during permission check function has_permission ensure …
Browse files Browse the repository at this point in the history
…`get_object` not called

ref: #471 #511
  • Loading branch information
jon-nfc committed Jan 31, 2025
1 parent 11d844e commit 3d9a1bc
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions app/access/tests/unit/mixin/test_permission.py
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ class HasPermission(


@patch.object(GenericAPIView, 'get_object')
def test_action_has_permission_function_get_object_called_once(self, get_object):
def test_action_has_permission_function_get_object_called_none(self, get_object):

get_object.return_value = self.obj

Expand Down Expand Up @@ -464,7 +464,7 @@ def test_action_has_permission_function_get_object_called_once(self, get_object)

OrganizationPermissionMixin().has_permission(request = view.request, view = view)

assert get_object.call_count == 1
assert get_object.call_count == 0



Expand Down Expand Up @@ -1331,7 +1331,7 @@ class HasPermissionDifferentOrganization(
):

@patch.object(GenericAPIView, 'get_object')
def test_action_has_permission_different_org_get_object_called_once(self, get_object):
def test_action_has_permission_different_org_get_object_called_none(self, get_object):

get_object.return_value = self.obj

Expand Down Expand Up @@ -1365,7 +1365,7 @@ def test_action_has_permission_different_org_get_object_called_once(self, get_ob

OrganizationPermissionMixin().has_permission(request = view.request, view = view)

assert get_object.call_count == 1
assert get_object.call_count == 0



Expand Down

0 comments on commit 3d9a1bc

Please sign in to comment.