From 336be9d8203d97ef512588c8aa1b36228213bdad Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Mon, 20 Apr 2026 13:53:03 +0530 Subject: [PATCH] refactor(test): set instance variables before calling utility method --- .../accounts_receivable/test_accounts_receivable.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/erpnext/accounts/report/accounts_receivable/test_accounts_receivable.py b/erpnext/accounts/report/accounts_receivable/test_accounts_receivable.py index b4004e3a3b8..8f879aa50f4 100644 --- a/erpnext/accounts/report/accounts_receivable/test_accounts_receivable.py +++ b/erpnext/accounts/report/accounts_receivable/test_accounts_receivable.py @@ -772,7 +772,7 @@ class TestAccountsReceivable(ERPNextTestSuite, AccountsTestMixin): def test_party_account_filter(self): si1 = self.create_sales_invoice() - self.customer2 = frappe.get_doc( + jane = frappe.get_doc( { "doctype": "Customer", "customer_name": "Jane Doe", @@ -781,9 +781,9 @@ class TestAccountsReceivable(ERPNextTestSuite, AccountsTestMixin): } ).insert() + self.customer = jane.name si2 = self.create_sales_invoice(do_not_submit=True) si2.posting_date = add_days(today(), -1) - si2.customer = self.customer2.name si2.currency = "USD" si2.conversion_rate = 80 si2.debit_to = self.debtors_usd @@ -991,7 +991,7 @@ class TestAccountsReceivable(ERPNextTestSuite, AccountsTestMixin): self.assertEqual(expected_data, report_output) def test_future_payments_on_foreign_currency(self): - self.customer2 = frappe.get_doc( + jane = frappe.get_doc( { "doctype": "Customer", "customer_name": "Jane Doe", @@ -999,10 +999,10 @@ class TestAccountsReceivable(ERPNextTestSuite, AccountsTestMixin): "default_currency": "USD", } ).insert() + self.customer = jane.name si = self.create_sales_invoice(do_not_submit=True) si.posting_date = add_days(today(), -1) - si.customer = self.customer2.name si.currency = "USD" si.conversion_rate = 80 si.debit_to = self.debtors_usd