  
      def test_permission_denied_html_view(self):
          response = self.client.get('/permission_denied')
          self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN)
          self.assertEqual(response.content, six.b("403 Forbidden"))
          self.assertEqual(response['Content-Type'], 'text/html; charset=utf-8')
  
      # 2 tests below are based on order of if statements in corresponding method
      # of TemplateHTMLRenderer
      def test_get_template_names_returns_own_template_name(self):
 
</s> remove         self.assertEqual(response.content, six.b("404 Not Found"))
 </s> add         self.assertEqual(response.content, b"404 Not Found") </s> remove         self.assertTrue(response.content in (
            six.b("403: Permission denied"), six.b("403 Forbidden")))
 </s> add         self.assertTrue(response.content in (b"403: Permission denied", b"403 Forbidden")) </s> remove             six.b("404: Not found"), six.b("404 Not Found")))
 </s> add             b"404: Not found", b"404 Not Found")) </s> remove         return super(BaseSerializer, cls).__new__(cls, *args, **kwargs)
 </s> add         return super().__new__(cls, *args, **kwargs) </s> remove         request = super(ViewSetMixin, self).initialize_request(request, *args, **kwargs)
 </s> add         request = super().initialize_request(request, *args, **kwargs)
        self.assertEqual(response.content, b"403 Forbidden")
  
      def test_permission_denied_html_view(self):
          response = self.client.get('/permission_denied')
          self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN)
        self.assertEqual(response.content, b"403 Forbidden")
          self.assertEqual(response['Content-Type'], 'text/html; charset=utf-8')
  
      # 2 tests below are based on order of if statements in corresponding method
      # of TemplateHTMLRenderer
      def test_get_template_names_returns_own_template_name(self):
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> 
tests/test_htmlrenderer.py