Merge pull request #56891 from frappe/fix/company-coa-test-abbr-collision

test: fix flaky test_coa_based_on_country_template (abbreviation collision)
This commit is contained in:
Nabin Hait
2026-07-05 12:57:43 +05:30
committed by GitHub

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