def log_error(error_data, error_type=None, **kwargs): kwargs.get('logger', default_logger).error( json.dumps(error_data, sort_keys=True, indent=1, cls=DjangoJSONEncoder)) if figure_helpers.log_pipeline_errors_to_db() or kwargs.get( 'log_pipeline_errors_to_db', False): log_error_to_db(error_data, error_type, **kwargs)
def test_log_pipeline_errors_to_db_true(features, expected): with mock.patch('figures.helpers.settings.FEATURES', features): assert figures_helpers.log_pipeline_errors_to_db() == expected