From 7fea5a5ca2185dd26cb3c4aead471b19995aefc0 Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Tue, 17 Feb 2026 17:59:22 +0530 Subject: [PATCH] refactor(test): make customer deterministic --- erpnext/selling/doctype/customer/test_customer.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/erpnext/selling/doctype/customer/test_customer.py b/erpnext/selling/doctype/customer/test_customer.py index 73eb4fc254b..211343966f9 100644 --- a/erpnext/selling/doctype/customer/test_customer.py +++ b/erpnext/selling/doctype/customer/test_customer.py @@ -89,14 +89,11 @@ class TestCustomer(ERPNextTestSuite): def test_party_details_tax_category(self): from erpnext.accounts.party import get_party_details - frappe.delete_doc_if_exists("Address", "_Test Address With Tax Category-Billing") - frappe.delete_doc_if_exists("Address", "_Test Address With Tax Category-Shipping") - # Tax Category without Address details = get_party_details("_Test Customer With Tax Category") self.assertEqual(details.tax_category, "_Test Tax Category 1") - billing_address = frappe.get_doc( + frappe.get_doc( doctype="Address", address_title="_Test Address With Tax Category", tax_category="_Test Tax Category 2", @@ -104,9 +101,10 @@ class TestCustomer(ERPNextTestSuite): address_line1="Station Road", city="_Test City", country="India", + is_primary_address=True, links=[dict(link_doctype="Customer", link_name="_Test Customer With Tax Category")], ).insert() - shipping_address = frappe.get_doc( + frappe.get_doc( doctype="Address", address_title="_Test Address With Tax Category", tax_category="_Test Tax Category 3", @@ -114,6 +112,7 @@ class TestCustomer(ERPNextTestSuite): address_line1="Station Road", city="_Test City", country="India", + is_shipping_address=True, links=[dict(link_doctype="Customer", link_name="_Test Customer With Tax Category")], ).insert() @@ -135,8 +134,6 @@ class TestCustomer(ERPNextTestSuite): # Rollback settings.determine_address_tax_category_from = rollback_setting settings.save() - billing_address.delete() - shipping_address.delete() def test_rename(self): # delete communication linked to these 2 customers