          return super(APIRequestFactory, self).generic(
              method, path, data, content_type, secure, **extra)
  
      def request(self, **kwargs):
          request = super(APIRequestFactory, self).request(**kwargs)
          request._dont_enforce_csrf_checks = not self.enforce_csrf_checks
          return request
  
  
  class ForceAuthClientHandler(ClientHandler):
 
</s> remove         return super(APIRequestFactory, self).generic(
 </s> add         return super().generic( </s> remove         return super(APIClient, self).request(**kwargs)
 </s> add         return super().request(**kwargs) </s> remove         super(APIRequestFactory, self).__init__(**defaults)
 </s> add         super().__init__(**defaults) </s> remove         response = super(APIClient, self).get(path, data=data, **extra)
 </s> add         response = super().get(path, data=data, **extra) </s> remove         request = factory.put('/{0}'.format(filtered_out_pk), data, format='json')
 </s> add         request = factory.put('/{}'.format(filtered_out_pk), data, format='json')
        request = super().request(**kwargs)
          return super(APIRequestFactory, self).generic(
              method, path, data, content_type, secure, **extra)
  
      def request(self, **kwargs):
        request = super().request(**kwargs)
          request._dont_enforce_csrf_checks = not self.enforce_csrf_checks
          return request
  
  
  class ForceAuthClientHandler(ClientHandler):
keep keep keep keep replace keep keep keep keep keep
 Dropped Python 2 compatibility. (#6615)

Thanks to Jon Dufresne (@jdufresne) for review.

Co-authored-by: Asif Saif Uddin <auvipy@gmail.com>
Co-authored-by: Rizwan Mansuri <Rizwan@webbyfox.com> 
rest_framework/test.py