          self.token = BasicToken.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 %s' % self.key
          response = self.csrf_client.post('/', {'example': 'example'}, HTTP_AUTHORIZATION=auth)
          self.assertEqual(response.status_code, 200)
  
      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         auth = 'Token %s' % self.key
 </s> add         auth = self.key </s> remove # TODO: TokenAuthentication, DigestAuthentication, OAuthAuthentication
 </s> add class TokenAuthentication(BaseAuthentication):
    """
    Use a token model for authentication.

    A custom token model may be used here, but must have the following minimum
    properties:

    * key -- The string identifying the token
    * user -- The user to which the token belongs
    * revoked -- The status of the token

    The token key should be passed in as a string to the "Authorization" HTTP
    header.  For example:

        Authorization: 0123456789abcdef0123456789abcdef

    """
    model = None

    def authenticate(self, request):
        key = request.META.get('HTTP_AUTHORIZATION', '').strip()

        if self.model is None:
            from djangorestframework.tokenauth.models import BasicToken
            self.model = BasicToken

        try:
             token = self.model.objects.get(key=key)
        except self.model.DoesNotExist:
             return None

        if token.user.is_active and not token.revoked:
            return (token.user, token)

# TODO: DigestAuthentication, OAuthAuthentication </s> remove from djangorestframework.tokenauth.authentication import TokenAuthentication
 </s> add from djangorestframework.authentication import TokenAuthentication
        auth = self.key
          self.token = BasicToken.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 = self.key
          response = self.csrf_client.post('/', {'example': 'example'}, HTTP_AUTHORIZATION=auth)
          self.assertEqual(response.status_code, 200)
  
      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
 Move TokenAuthentication class into djangorestframework.authentication 
djangorestframework/tests/authentication.py