      def test_not_found_html_view_with_template(self):
          response = self.client.get('/not_found')
          self.assertEqual(response.status_code, status.HTTP_404_NOT_FOUND)
          self.assertTrue(response.content in (
              six.b("404: Not found"), six.b("404 Not Found")))
          self.assertEqual(response['Content-Type'], 'text/html; charset=utf-8')
  
      def test_permission_denied_html_view_with_template(self):
          response = self.client.get('/permission_denied')
          self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN)
 
</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         self.assertEqual(response.content, six.b("403 Forbidden"))
 </s> add         self.assertEqual(response.content, b"403 Forbidden") </s> remove         response = super(APIClient, self).put(
 </s> add         response = super().put( </s> remove         response = super(APIClient, self).patch(
 </s> add         response = super().patch(
            b"404: Not found", b"404 Not Found"))
      def test_not_found_html_view_with_template(self):
          response = self.client.get('/not_found')
          self.assertEqual(response.status_code, status.HTTP_404_NOT_FOUND)
          self.assertTrue(response.content in (
            b"404: Not found", b"404 Not Found"))
          self.assertEqual(response['Content-Type'], 'text/html; charset=utf-8')
  
      def test_permission_denied_html_view_with_template(self):
          response = self.client.get('/permission_denied')
          self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN)
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