mirror of
https://github.com/frappe/erpnext.git
synced 2026-09-14 17:33:09 +00:00
refactor(test): move commits inside test guard clause
This commit is contained in:
@@ -62,7 +62,9 @@ def book_depreciation_entries(date):
|
||||
accounting_dimensions,
|
||||
)
|
||||
|
||||
frappe.db.commit()
|
||||
if not frappe.in_test:
|
||||
frappe.db.commit()
|
||||
|
||||
except Exception as e:
|
||||
frappe.db.rollback()
|
||||
failed_assets.append(asset_name)
|
||||
@@ -72,7 +74,8 @@ def book_depreciation_entries(date):
|
||||
if failed_assets:
|
||||
set_depr_entry_posting_status_for_failed_assets(failed_assets)
|
||||
notify_depr_entry_posting_error(failed_assets, error_logs)
|
||||
frappe.db.commit()
|
||||
if not frappe.in_test:
|
||||
frappe.db.commit()
|
||||
|
||||
|
||||
def get_depreciable_assets_data(date):
|
||||
|
||||
Reference in New Issue
Block a user