          """
          self.handler._force_user = user
          self.handler._force_token = token
  
      def request(self, **kwargs):
          # Ensure that any credentials set get added to every request.
          kwargs.update(self._credentials)
          return super(APIClient, self).request(**kwargs)
  
 
</s>
        if user is None:
            self.logout()  # Also clear any possible session info if required
          """
          self.handler._force_user = user
          self.handler._force_token = token
        if user is None:
            self.logout()  # Also clear any possible session info if required
  
      def request(self, **kwargs):
          # Ensure that any credentials set get added to every request.
          kwargs.update(self._credentials)
          return super(APIClient, self).request(**kwargs)
  
keep keep add keep keep keep keep keep keep
 force_authenticate(None) also clears session info.

Closes #1055.
rest_framework/test.py