          self.enforce_csrf_checks = enforce_csrf_checks
          self.renderer_classes = {}
          for cls in self.renderer_classes_list:
              self.renderer_classes[cls.format] = cls
          super(APIRequestFactory, self).__init__(**defaults)
  
      def _encode_data(self, data, format=None, content_type=None):
          """
          Encode the data returning a two tuple of (bytes, content_type)
          """
 
</s> remove         return super(APIRequestFactory, self).generic(
 </s> add         return super().generic( </s> remove         request = super(APIRequestFactory, self).request(**kwargs)
 </s> add         request = super().request(**kwargs) </s> remove         context = super(AdminRenderer, self).get_context(
 </s> add         context = super().get_context( </s> remove         super(APIClient, self).__init__(**defaults)
 </s> add         super().__init__(**defaults) </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')
        super().__init__(**defaults)
          self.enforce_csrf_checks = enforce_csrf_checks
          self.renderer_classes = {}
          for cls in self.renderer_classes_list:
              self.renderer_classes[cls.format] = cls
        super().__init__(**defaults)
  
      def _encode_data(self, data, format=None, content_type=None):
          """
          Encode the data returning a two tuple of (bytes, content_type)
          """
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