fix: test cases updated
diff --git a/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py b/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py
index 59bd637..a12f06b 100644
--- a/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py
+++ b/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py
@@ -1589,9 +1589,9 @@
 
 
 def enable_discount_accounting(enable=1):
-	accounts_settings = frappe.get_doc("Accounts Settings")
-	accounts_settings.enable_discount_accounting = enable
-	accounts_settings.save()
+	buying_settings = frappe.get_doc("Buying Settings")
+	buying_settings.enable_discount_accounting = enable
+	buying_settings.save()
 
 
 def make_purchase_invoice(**args):
diff --git a/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py
index caa70d0..eaab941 100644
--- a/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py
+++ b/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py
@@ -2685,9 +2685,6 @@
 		)
 
 	def test_sales_invoice_with_discount_accounting_enabled(self):
-		from erpnext.accounts.doctype.purchase_invoice.test_purchase_invoice import (
-			enable_discount_accounting,
-		)
 
 		enable_discount_accounting()
 
@@ -2708,9 +2705,6 @@
 		enable_discount_accounting(enable=0)
 
 	def test_additional_discount_for_sales_invoice_with_discount_accounting_enabled(self):
-		from erpnext.accounts.doctype.purchase_invoice.test_purchase_invoice import (
-			enable_discount_accounting,
-		)
 
 		enable_discount_accounting()
 		additional_discount_account = create_account(
@@ -3181,6 +3175,12 @@
 		)
 
 
+def enable_discount_accounting(enable=1):
+	selling_settings = frappe.get_doc("Selling Settings")
+	selling_settings.enable_discount_accounting = enable
+	selling_settings.save()
+
+
 def get_sales_invoice_for_e_invoice():
 	si = make_sales_invoice_for_ewaybill()
 	si.naming_series = "INV-2020-.#####"