refactor(test): remove explicit sql delete calls

(cherry picked from commit b16dd3f2dd)
This commit is contained in:
ruthra kumar
2026-04-21 17:35:34 +05:30
committed by Mergify
parent 5923618df3
commit 91a748d9bf
23 changed files with 2 additions and 154 deletions

View File

@@ -137,12 +137,6 @@ class TestCustomer(ERPNextTestSuite):
# delete communication linked to these 2 customers
new_name = "_Test Customer 1 Renamed"
for name in ("_Test Customer 1", new_name):
frappe.db.sql(
"""delete from `tabComment`
where reference_doctype=%s and reference_name=%s""",
("Customer", name),
)
# add comments
comment = frappe.get_doc("Customer", "_Test Customer 1").add_comment(
@@ -209,8 +203,6 @@ class TestCustomer(ERPNextTestSuite):
so.save()
def test_duplicate_customer(self):
frappe.db.sql("delete from `tabCustomer` where customer_name='_Test Customer 1'")
if not frappe.db.get_value("Customer", "_Test Customer 1"):
test_customer_1 = frappe.get_doc(get_customer_dict("_Test Customer 1")).insert(
ignore_permissions=True

View File

@@ -11,8 +11,6 @@ from erpnext.tests.utils import ERPNextTestSuite
class TestAnalytics(ERPNextTestSuite):
def test_sales_analytics(self):
frappe.db.sql("delete from `tabSales Order` where company='_Test Company 2'")
create_sales_orders()
self.compare_result_for_customer()