      @translation.override('fr')
      def test_message(self):
          # this test largely acts as a sanity test to ensure the translation files are present.
          self.assertEqual(_('A server error occurred.'), 'Une erreur du serveur est survenue.')
          self.assertEqual(six.text_type(APIException()), 'Une erreur du serveur est survenue.')
  
  
  def test_server_error():
      request = RequestFactory().get('/')
      response = server_error(request)
 
</s> remove     if isinstance(auth, text_type):
 </s> add     if isinstance(auth, str): </s> remove         @python_2_unicode_compatible
        class MockLazyStr(object):
 </s> add         class MockLazyStr: </s> remove class ForcedAuthentication(object):
 </s> add class ForcedAuthentication: </s> remove         request = factory.patch('/{0}'.format(obj.pk), {'number_value': 101}, format='json')
 </s> add         request = factory.patch('/{}'.format(obj.pk), {'number_value': 101}, format='json') </s> remove             raise ParseError('Multipart form parse error - %s' % six.text_type(exc))
 </s> add             raise ParseError('Multipart form parse error - %s' % str(exc))
        self.assertEqual(str(APIException()), 'Une erreur du serveur est survenue.')
      @translation.override('fr')
      def test_message(self):
          # this test largely acts as a sanity test to ensure the translation files are present.
          self.assertEqual(_('A server error occurred.'), 'Une erreur du serveur est survenue.')
        self.assertEqual(str(APIException()), 'Une erreur du serveur est survenue.')
  
  
  def test_server_error():
      request = RequestFactory().get('/')
      response = server_error(request)
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_exceptions.py