  
      def test_not_found_html_view(self):
          response = self.client.get('/not_found')
          self.assertEquals(response.status_code, 404)
          self.assertEquals(response.content, "404 Not Found")
          self.assertEquals(response['Content-Type'], 'text/html')
  
      def test_permission_denied_html_view(self):
          response = self.client.get('/permission_denied')
          self.assertEquals(response.status_code, 403)
 
</s> remove         self.assertEquals(response.content, "404: Not found")
 </s> add         self.assertEquals(response.content, six.b("404: Not found")) </s> remove         self.assertEquals(response.content, "403 Forbidden")
 </s> add         self.assertEquals(response.content, six.b("403 Forbidden")) </s> remove         self.assertEquals(response.content, "403: Permission denied")
 </s> add         self.assertEquals(response.content, six.b("403: Permission denied")) </s> remove         self.assertEquals(response.content, '')
 </s> add         self.assertEquals(response.content, six.b('')) </s> remove         self.assertEqual(json.loads(response.content)['token'], self.key)
 </s> add         self.assertEqual(json.loads(response.content.decode('ascii'))['token'], self.key)
        self.assertEquals(response.content, six.b("404 Not Found"))
  
      def test_not_found_html_view(self):
          response = self.client.get('/not_found')
          self.assertEquals(response.status_code, 404)
        self.assertEquals(response.content, six.b("404 Not Found"))
          self.assertEquals(response['Content-Type'], 'text/html')
  
      def test_permission_denied_html_view(self):
          response = self.client.get('/permission_denied')
          self.assertEquals(response.status_code, 403)
keep keep keep keep replace keep keep keep keep keep
 Every (base) test should now pass with python3. 
rest_framework/tests/htmlrenderer.py