def METHOD_NAME(self, mock_update_job, mock_run_command):
    app._got_first_request = False
    async_query_manager.init_app(app)
    query_context = get_query_context("birth_names")
    user = security_manager.find_user("gamma")
    job_metadata = {
        "channel_id": str(uuid4()),
        "job_id": str(uuid4()),
        "user_id": user.id,
        "status": "pending",
        "errors": [],
    }
    with pytest.raises(ChartDataQueryFailedError):
        load_chart_data_into_cache(job_metadata, query_context)
    mock_run_command.assert_called_once_with(cache=True)
    errors = [{"message": "Error: foo"}]
    mock_update_job.assert_called_once_with(job_metadata, "error", errors=errors)