      OAuth2Authentication
  )
  from rest_framework.authtoken.models import Token
  from rest_framework.compat import patterns, url, include
  from rest_framework.compat import oauth2_provider, oauth2_provider_models
  from rest_framework.compat import oauth, oauth_provider
  from rest_framework.tests.utils import RequestFactory
  from rest_framework.views import APIView
  import json
  import base64
 
</s>
from rest_framework.compat import oauth2_provider, oauth2_provider_models, oauth2_provider_scope
      OAuth2Authentication
  )
  from rest_framework.authtoken.models import Token
  from rest_framework.compat import patterns, url, include
from rest_framework.compat import oauth2_provider, oauth2_provider_models, oauth2_provider_scope
  from rest_framework.compat import oauth, oauth_provider
  from rest_framework.tests.utils import RequestFactory
  from rest_framework.views import APIView
  import json
  import base64
keep keep keep keep replace keep keep keep keep keep
 Add TokenHasReadWriteScope class for permissions based on scopes
rest_framework/tests/authentication.py