  from rest_framework import generics, status, permissions, authentication, HTTP_HEADER_ENCODING
  from rest_framework.test import APIRequestFactory
  import base64
  
  factory = APIRequestFactory()
  
  
 
</s> remove from rest_framework.compat import oauth2_provider_scope, oauth2_constants
 </s> add from rest_framework.compat import oauth2_provider_scope, oauth2_constants, guardian
from rest_framework.compat import guardian
  from rest_framework import generics, status, permissions, authentication, HTTP_HEADER_ENCODING
  from rest_framework.test import APIRequestFactory
from rest_framework.compat import guardian
  import base64
  
  factory = APIRequestFactory()
  
  
keep add keep keep keep keep keep
 added guardian as optional requirement, stubbed out object-level permission class 
rest_framework/tests/test_permissions.py