refactor(test): hardcoded names over dynamic ones

Much faster bootstrap without those get_doc calls
This commit is contained in:
ruthra kumar
2026-03-01 21:33:45 +05:30
parent 5a4a77f5d2
commit e67165d6ce
26 changed files with 67 additions and 58 deletions

View File

@@ -120,7 +120,7 @@ class TestLead(ERPNextTestSuite):
create_todo("followup", "Lead", lead.name)
opportunity = make_opportunity(lead.name)
opportunity.company = self.companies[0].name
opportunity.company = "_Test Company"
opportunity.save()
self.assertEqual(opportunity.get("party_name"), lead.name)

View File

@@ -54,7 +54,7 @@ class TestOpportunity(ERPNextTestSuite):
self.assertEqual(doc.status, "Quotation")
def test_make_new_lead_if_required(self):
opp_doc = make_opportunity_from_lead(self.companies[0].name)
opp_doc = make_opportunity_from_lead("_Test Company")
self.assertTrue(opp_doc.party_name)
self.assertEqual(opp_doc.opportunity_from, "Lead")

View File

@@ -11,7 +11,7 @@ from erpnext.tests.utils import ERPNextTestSuite
class TestProspect(ERPNextTestSuite):
def test_add_lead_to_prospect_and_address_linking(self):
company = self.companies[0].name
company = "_Test Company"
lead_doc = make_lead()
address_doc = make_address(address_title=lead_doc.name)
address_doc.append("links", {"link_doctype": lead_doc.doctype, "link_name": lead_doc.name})
@@ -37,7 +37,7 @@ class TestProspect(ERPNextTestSuite):
"doctype": "Prospect",
"company_name": "_Test Prospect",
"customer_group": "_Test Customer Group",
"company": self.companies[0].name,
"company": "_Test Company",
}
)
prospect.insert()