mirror of
https://github.com/frappe/erpnext.git
synced 2026-09-03 16:40:19 +00:00
refactor(test): move commits inside test guard clause
(cherry picked from commit ed76d6699a)
This commit is contained in:
@@ -927,7 +927,7 @@ def update_transactions_annual_history(company, commit=False):
|
||||
transactions_history = get_all_transactions_annual_history(company)
|
||||
frappe.db.set_value("Company", company, "transactions_annual_history", json.dumps(transactions_history))
|
||||
|
||||
if commit:
|
||||
if commit and not frappe.in_test:
|
||||
frappe.db.commit()
|
||||
|
||||
|
||||
@@ -936,7 +936,9 @@ def cache_companies_monthly_sales_history():
|
||||
for company in companies:
|
||||
update_company_monthly_sales(company)
|
||||
update_transactions_annual_history(company)
|
||||
frappe.db.commit()
|
||||
|
||||
if not frappe.in_test:
|
||||
frappe.db.commit()
|
||||
|
||||
|
||||
@frappe.whitelist()
|
||||
|
||||
Reference in New Issue
Block a user