  
          self.consumer = Consumer.objects.create(key=self.CONSUMER_KEY, secret=self.CONSUMER_SECRET,
              name='example', user=self.user, status=self.consts.ACCEPTED)
  
          self.resource = Resource.objects.create(name="resource name", url="api/")
          self.token = OAuthToken.objects.create(user=self.user, consumer=self.consumer, resource=self.resource,
              token_type=OAuthToken.ACCESS, key=self.TOKEN_KEY, secret=self.TOKEN_SECRET, is_approved=True
          )
  
      def _create_authorization_header(self):
          params = {
 
</s> remove         read_write_access_token.resource.is_readonly = False
        read_write_access_token.resource.save()
 </s> add         read_write_access_token.scope.is_readonly = False
        read_write_access_token.scope.save() </s> remove         read_only_access_token.resource.is_readonly = True
        read_only_access_token.resource.save()
 </s> add         read_only_access_token.scope.is_readonly = True
        read_only_access_token.scope.save() </s> remove         read_only_access_token.resource.is_readonly = True
        read_only_access_token.resource.save()
 </s> add         read_only_access_token.scope.is_readonly = True
        read_only_access_token.scope.save() </s> remove         """Ensure POSTing with a readonly resource instead of a write scope fails"""
 </s> add         """Ensure POSTing with a readonly scope instead of a write scope fails"""
        self.scope = Scope.objects.create(name="resource name", url="api/")
        self.token = OAuthToken.objects.create(user=self.user, consumer=self.consumer, scope=self.scope,
  
          self.consumer = Consumer.objects.create(key=self.CONSUMER_KEY, secret=self.CONSUMER_SECRET,
              name='example', user=self.user, status=self.consts.ACCEPTED)
  
        self.scope = Scope.objects.create(name="resource name", url="api/")
        self.token = OAuthToken.objects.create(user=self.user, consumer=self.consumer, scope=self.scope,
        self.scope = Scope.objects.create(name="resource name", url="api/")
        self.token = OAuthToken.objects.create(user=self.user, consumer=self.consumer, scope=self.scope,
              token_type=OAuthToken.ACCESS, key=self.TOKEN_KEY, secret=self.TOKEN_SECRET, is_approved=True
          )
  
      def _create_authorization_header(self):
          params = {
keep keep keep keep replace replace keep keep keep keep keep
 Compat fixes for django-oauth-plus versions 2.0-2.2.1 
rest_framework/tests/test_authentication.py