Skip to content

Commit

Permalink
fix(test records): rollback only the test record that exists
Browse files Browse the repository at this point in the history
  • Loading branch information
vorasmit committed May 12, 2024
1 parent a12fc11 commit be410de
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion frappe/test_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,9 @@ def revert_naming(d):
test_records = frappe.get_test_records(doctype)

for doc in test_records:
if not reset:
frappe.db.savepoint("creating_test_record")

if not doc.get("doctype"):
doc["doctype"] = doctype

Expand All @@ -461,7 +464,7 @@ def revert_naming(d):
d.set_new_name()

if frappe.db.exists(d.doctype, d.name) and not reset:
frappe.db.rollback()
frappe.db.rollback(save_point="creating_test_record")
# do not create test records, if already exists
continue

Expand Down

0 comments on commit be410de

Please sign in to comment.