test: use a unique company abbreviation to fix COA-template flake

This commit is contained in:
Nabin Hait
2026-07-05 12:44:31 +05:30
parent e86f6fc89c
commit df4fc6b186

View File

@@ -68,7 +68,12 @@ class TestCompany(ERPNextTestSuite):
try:
company = frappe.new_doc("Company")
company.company_name = template
company.abbr = random_string(3)
# a short random abbr collides with existing test companies often enough
# to flake, so pick one that is verified unique
abbr = random_string(3)
while frappe.db.exists("Company", {"abbr": abbr}):
abbr = random_string(3)
company.abbr = abbr
company.default_currency = "USD"
company.create_chart_of_accounts_based_on = "Standard Template"
company.chart_of_accounts = template