  from rest_framework.response import Response
  from rest_framework.views import APIView
  
  
  class MockView(APIView):
      authentication_classes = (authentication.SessionAuthentication,)
      renderer_classes = (renderers.BrowsableAPIRenderer, renderers.JSONRenderer)
 
</s> remove from .views import MockView
 </s> add from .views import BasicModelWithUsersViewSet, MockView
from rest_framework.viewsets import ModelViewSet

from ..models import BasicModelWithUsers
from .serializers import BasicSerializer


class OrganizationPermissions(BasePermission):
    def has_object_permission(self, request, view, obj):
        return request.user.is_staff or (request.user == obj.owner.organization_user.user)
  from rest_framework.response import Response
  from rest_framework.views import APIView
from rest_framework.viewsets import ModelViewSet

from ..models import BasicModelWithUsers
from .serializers import BasicSerializer


class OrganizationPermissions(BasePermission):
    def has_object_permission(self, request, view, obj):
        return request.user.is_staff or (request.user == obj.owner.organization_user.user)
  
  
  class MockView(APIView):
      authentication_classes = (authentication.SessionAuthentication,)
      renderer_classes = (renderers.BrowsableAPIRenderer, renderers.JSONRenderer)
keep add keep keep keep keep keep
 tests for #5127 (#7715)

* tests for #5127

* Resolves #5127 
tests/browsable_api/views.py