          self.token = Token.objects.create(key=self.key, user=self.user)
  
      def test_post_form_passing_token_auth(self):
          """Ensure POSTing json over token auth with correct credentials passes and does not require CSRF"""
          auth = "Token " + self.key
          response = self.csrf_client.post('/token/', {'example': 'example'}, HTTP_AUTHORIZATION=auth)
          self.assertEqual(response.status_code, status.HTTP_200_OK)
  
      def test_post_json_passing_token_auth(self):
          """Ensure POSTing form over token auth with correct credentials passes and does not require CSRF"""
 
</s> remove         if not auth or auth[0].lower() != "token":
 </s> add         if not auth or auth[0].lower() != b'token': </s> remove         if not auth or auth[0].lower() != 'bearer':
 </s> add         if not auth or auth[0].lower() != b'bearer': </s> remove         if len(auth) > 2:
 </s> add             raise exceptions.AuthenticationFailed(msg)
        elif len(auth) > 2: </s> remove         if len(auth) > 2:
 </s> add             raise exceptions.AuthenticationFailed(msg)
        elif len(auth) > 2: </s> remove         if len(auth) > 2:
 </s> add             raise exceptions.AuthenticationFailed(msg)
        elif len(auth) > 2:
        auth = 'Token ' + self.key
          self.token = Token.objects.create(key=self.key, user=self.user)
  
      def test_post_form_passing_token_auth(self):
          """Ensure POSTing json over token auth with correct credentials passes and does not require CSRF"""
        auth = 'Token ' + self.key
          response = self.csrf_client.post('/token/', {'example': 'example'}, HTTP_AUTHORIZATION=auth)
          self.assertEqual(response.status_code, status.HTTP_200_OK)
  
      def test_post_json_passing_token_auth(self):
          """Ensure POSTing form over token auth with correct credentials passes and does not require CSRF"""
keep keep keep keep replace keep keep keep keep keep
 Fixes for auth header checking. 
rest_framework/tests/authentication.py