refactor(test): remove explicit sql delete calls

This commit is contained in:
ruthra kumar
2026-04-21 17:35:34 +05:30
parent ffae7e42d3
commit b16dd3f2dd
23 changed files with 2 additions and 154 deletions

View File

@@ -9,7 +9,6 @@ from erpnext.tests.utils import ERPNextTestSuite
class TestContract(ERPNextTestSuite):
def setUp(self):
frappe.db.sql("delete from `tabContract`")
self.contract_doc = get_contract()
def test_validate_start_date_before_end_date(self):

View File

@@ -86,9 +86,6 @@ class TestLead(ERPNextTestSuite):
self.assertEqual(len(address_1.get("links")), 1)
def test_prospect_creation_from_lead(self):
frappe.db.sql("delete from `tabLead` where lead_name='Rahul Tripathi'")
frappe.db.sql("delete from `tabProspect` where name='Prospect Company'")
lead = make_lead(
first_name="Rahul",
last_name="Tripathi",
@@ -108,9 +105,6 @@ class TestLead(ERPNextTestSuite):
self.assertEqual(event.event_participants[1].reference_docname, prospect)
def test_opportunity_from_lead(self):
frappe.db.sql("delete from `tabLead` where lead_name='Rahul Tripathi'")
frappe.db.sql("delete from `tabOpportunity` where party_name='Rahul Tripathi'")
lead = make_lead(
first_name="Rahul",
last_name="Tripathi",
@@ -138,9 +132,6 @@ class TestLead(ERPNextTestSuite):
)
def test_copy_events_from_lead_to_prospect(self):
frappe.db.sql("delete from `tabLead` where lead_name='Rahul Tripathi'")
frappe.db.sql("delete from `tabProspect` where name='Prospect Company'")
lead = make_lead(
first_name="Rahul",
last_name="Tripathi",