test: remove toleration for test record creation failure (#28143)
this ensures test record creation conforms with the spec or fails sharply
This commit is contained in:
parent
860ae4fdcb
commit
30dda5287c
1 changed files with 4 additions and 10 deletions
|
|
@ -323,17 +323,11 @@ def _try_create(record, reset=False, commit=False) -> tuple["Document", bool]:
|
|||
|
||||
d.docstatus = 0
|
||||
|
||||
tolerated_errors = (frappe.NameError, *(d.flags.ignore_these_exceptions_in_test or []))
|
||||
try:
|
||||
d.run_method("before_test_insert")
|
||||
d.insert(ignore_if_duplicate=True)
|
||||
d.run_method("before_test_insert")
|
||||
d.insert(ignore_if_duplicate=True)
|
||||
|
||||
if docstatus == 1:
|
||||
d.submit()
|
||||
|
||||
except tolerated_errors as e:
|
||||
logger.warning(f"Error during test record creation for {d.name} ({d.doctype}): {e!s}")
|
||||
revert_naming(d)
|
||||
if docstatus == 1:
|
||||
d.submit()
|
||||
|
||||
if commit:
|
||||
frappe.db.commit()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue