mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-05 05:09:11 +00:00
refactor(test): use change_settings decorator
(cherry picked from commit ee94fb37c8)
This commit is contained in:
@@ -3785,6 +3785,7 @@ def check_gl_entries(doc, voucher_no, expected_gle, posting_date):
|
|||||||
self.assertEqual(len(actual), 4)
|
self.assertEqual(len(actual), 4)
|
||||||
self.assertEqual(expected, actual)
|
self.assertEqual(expected, actual)
|
||||||
|
|
||||||
|
@change_settings("Accounts Settings", {"enable_common_party_accounting": True})
|
||||||
def test_common_party_with_foreign_currency_jv(self):
|
def test_common_party_with_foreign_currency_jv(self):
|
||||||
from erpnext.accounts.doctype.account.test_account import create_account
|
from erpnext.accounts.doctype.account.test_account import create_account
|
||||||
from erpnext.accounts.doctype.opening_invoice_creation_tool.test_opening_invoice_creation_tool import (
|
from erpnext.accounts.doctype.opening_invoice_creation_tool.test_opening_invoice_creation_tool import (
|
||||||
@@ -3831,11 +3832,8 @@ def check_gl_entries(doc, voucher_no, expected_gle, posting_date):
|
|||||||
supp_doc.append("accounts", test_account_details)
|
supp_doc.append("accounts", test_account_details)
|
||||||
supp_doc.save()
|
supp_doc.save()
|
||||||
|
|
||||||
# enable common party accounting
|
|
||||||
frappe.db.set_single_value("Accounts Settings", "enable_common_party_accounting", 1)
|
|
||||||
|
|
||||||
# create a party link between customer & supplier
|
# create a party link between customer & supplier
|
||||||
party_link = create_party_link("Supplier", supplier, customer)
|
create_party_link("Supplier", supplier, customer)
|
||||||
|
|
||||||
# create a sales invoice
|
# create a sales invoice
|
||||||
si = create_sales_invoice(
|
si = create_sales_invoice(
|
||||||
@@ -3869,9 +3867,6 @@ def check_gl_entries(doc, voucher_no, expected_gle, posting_date):
|
|||||||
self.assertTrue(jv)
|
self.assertTrue(jv)
|
||||||
self.assertEqual(jv[0], si.grand_total)
|
self.assertEqual(jv[0], si.grand_total)
|
||||||
|
|
||||||
party_link.delete()
|
|
||||||
frappe.db.set_single_value("Accounts Settings", "enable_common_party_accounting", 0)
|
|
||||||
|
|
||||||
|
|
||||||
def set_advance_flag(company, flag, default_account):
|
def set_advance_flag(company, flag, default_account):
|
||||||
frappe.db.set_value(
|
frappe.db.set_value(
|
||||||
|
|||||||
Reference in New Issue
Block a user