def pretty_print(request_list): """ send the same list of requests as you would to qb_request without the key or model name. The requests will be formatted to qbxml and saved to files in the worker directory where they can be tested using the qbxml validator from intuit ex: pretty_print.delay([ (item_key, model_name, ('ItemReceiptAddRq', receipt_instance.quickbooks_request_tuple)), (item_key, model_name, ('ItemReceiptAddRq', receipt_instance.quickbooks_request_tuple)) ]) """ qb = QuickBooks(**QB_LOOKUP) for entry in request_list: surrogate_key, model_name, request_body = entry request_type, request_dict = request_body qb.format_request(request_type, request_dictionary=request_dict, save_xml=True)