def METHOD_NAME(self):
    exception_handler = api_settings.EXCEPTION_HANDLER
    with self.assertRaises(APIException):
        with self.settings(DEBUG_PROPAGATE_EXCEPTIONS=True):
            try:
                raise APIException()
            except Exception as exc:
                exception_handler(exc, {})