          else:
              format = format or self.default_format
  
              assert format in self.renderer_classes, (
                  "Invalid format '{0}'. Available formats are {1}. "
                  "Set TEST_REQUEST_RENDERER_CLASSES to enable "
                  "extra request formats.".format(
                      format,
                      ', '.join(["'" + fmt + "'" for fmt in self.renderer_classes])
                  )
 
</s> remove         class MockRenderer(object):
 </s> add         class MockRenderer: </s> remove         urls = super(DefaultRouter, self).get_urls()
 </s> add         urls = super().get_urls() </s> remove class DynamicListRoute(object):
 </s> add class DynamicListRoute: </s> remove         return super(NamespaceVersioning, self).reverse(
 </s> add         return super().reverse( </s> remove         value = six.text_type(data)
 </s> add         value = str(data)
                "Invalid format '{}'. Available formats are {}. "
          else:
              format = format or self.default_format
  
              assert format in self.renderer_classes, (
                "Invalid format '{}'. Available formats are {}. "
                  "Set TEST_REQUEST_RENDERER_CLASSES to enable "
                  "extra request formats.".format(
                      format,
                      ', '.join(["'" + fmt + "'" for fmt in self.renderer_classes])
                  )
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