mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-04 04:39:11 +00:00
refactor(test): remove explicit sql delete calls
(cherry picked from commit b16dd3f2dd)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user