                  renderer.media_type, renderer.charset
              )
  
              # Coerce text to bytes if required.
              if isinstance(ret, six.text_type):
                  ret = bytes(ret.encode(renderer.charset))
  
          return ret, content_type
  
      def get(self, path, data=None, **extra):
 
</s> remove             content_type = "{0}; charset={1}".format(
 </s> add             content_type = "{}; charset={}".format( </s> remove         if isinstance(ret, six.text_type):
 </s> add         if isinstance(ret, str): </s> remove         response = super(APIClient, self).get(path, data=data, **extra)
 </s> add         response = super().get(path, data=data, **extra) </s> remove         return super(APIClient, self).request(**kwargs)
 </s> add         return super().request(**kwargs) </s> remove             content_type = "{0}; charset={1}".format(media_type, charset)
 </s> add             content_type = "{}; charset={}".format(media_type, charset)
            if isinstance(ret, str):
                  renderer.media_type, renderer.charset
              )
  
              # Coerce text to bytes if required.
            if isinstance(ret, str):
                  ret = bytes(ret.encode(renderer.charset))
  
          return ret, content_type
  
      def get(self, path, data=None, **extra):
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