From 3fabf4aaa48943f29429931cf0d3e9a3c08a65e5 Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Sat, 22 Jun 2024 19:32:07 +0530 Subject: [PATCH] refactor(test): make and use a different party for subscription --- .../accounts/doctype/subscription/test_subscription.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/erpnext/accounts/doctype/subscription/test_subscription.py b/erpnext/accounts/doctype/subscription/test_subscription.py index 2c179ce297a..8957fb90de6 100644 --- a/erpnext/accounts/doctype/subscription/test_subscription.py +++ b/erpnext/accounts/doctype/subscription/test_subscription.py @@ -476,7 +476,7 @@ class TestSubscription(FrappeTestCase): start_date="2021-01-01", submit_invoice=0, generate_new_invoices_past_due_date=1, - party="_Test Subscription Customer", + party="_Test Subscription Customer John Doe", ) # create invoices for the first two moths @@ -569,6 +569,12 @@ def create_parties(): customer.append("accounts", {"company": "_Test Company", "account": "_Test Receivable USD - _TC"}) customer.insert() + if not frappe.db.exists("Customer", "_Test Subscription Customer John Doe"): + customer = frappe.new_doc("Customer") + customer.customer_name = "_Test Subscription Customer John Doe" + customer.append("accounts", {"company": "_Test Company", "account": "_Test Receivable - _TC"}) + customer.insert() + def reset_settings(): settings = frappe.get_single("Subscription Settings")