refactor(test): update repost settings before test case
(cherry picked from commit acb6e8e1209b7ac97e0503ad89d9f52b8a8e28d5)
This commit is contained in:
parent
6469526c26
commit
522113ba98
@ -20,18 +20,11 @@ class TestRepostAccountingLedger(AccountsTestMixin, FrappeTestCase):
|
|||||||
self.create_company()
|
self.create_company()
|
||||||
self.create_customer()
|
self.create_customer()
|
||||||
self.create_item()
|
self.create_item()
|
||||||
self.update_repost_settings()
|
update_repost_settings()
|
||||||
|
|
||||||
def teadDown(self):
|
def teadDown(self):
|
||||||
frappe.db.rollback()
|
frappe.db.rollback()
|
||||||
|
|
||||||
def update_repost_settings(self):
|
|
||||||
allowed_types = ["Sales Invoice", "Purchase Invoice", "Payment Entry", "Journal Entry"]
|
|
||||||
repost_settings = frappe.get_doc("Repost Accounting Ledger Settings")
|
|
||||||
for x in allowed_types:
|
|
||||||
repost_settings.append("allowed_types", {"document_type": x, "allowed": True})
|
|
||||||
repost_settings.save()
|
|
||||||
|
|
||||||
def test_01_basic_functions(self):
|
def test_01_basic_functions(self):
|
||||||
si = create_sales_invoice(
|
si = create_sales_invoice(
|
||||||
item=self.item,
|
item=self.item,
|
||||||
@ -209,3 +202,11 @@ class TestRepostAccountingLedger(AccountsTestMixin, FrappeTestCase):
|
|||||||
|
|
||||||
self.assertIsNotNone(frappe.db.exists("GL Entry", {"voucher_no": si.name, "is_cancelled": 1}))
|
self.assertIsNotNone(frappe.db.exists("GL Entry", {"voucher_no": si.name, "is_cancelled": 1}))
|
||||||
self.assertIsNotNone(frappe.db.exists("GL Entry", {"voucher_no": pe.name, "is_cancelled": 1}))
|
self.assertIsNotNone(frappe.db.exists("GL Entry", {"voucher_no": pe.name, "is_cancelled": 1}))
|
||||||
|
|
||||||
|
|
||||||
|
def update_repost_settings():
|
||||||
|
allowed_types = ["Sales Invoice", "Purchase Invoice", "Payment Entry", "Journal Entry"]
|
||||||
|
repost_settings = frappe.get_doc("Repost Accounting Ledger Settings")
|
||||||
|
for x in allowed_types:
|
||||||
|
repost_settings.append("allowed_types", {"document_type": x, "allowed": True})
|
||||||
|
repost_settings.save()
|
||||||
|
@ -2799,6 +2799,12 @@ class TestSalesInvoice(FrappeTestCase):
|
|||||||
@change_settings("Selling Settings", {"enable_discount_accounting": 1})
|
@change_settings("Selling Settings", {"enable_discount_accounting": 1})
|
||||||
def test_additional_discount_for_sales_invoice_with_discount_accounting_enabled(self):
|
def test_additional_discount_for_sales_invoice_with_discount_accounting_enabled(self):
|
||||||
|
|
||||||
|
from erpnext.accounts.doctype.repost_accounting_ledger.test_repost_accounting_ledger import (
|
||||||
|
update_repost_settings,
|
||||||
|
)
|
||||||
|
|
||||||
|
update_repost_settings()
|
||||||
|
|
||||||
additional_discount_account = create_account(
|
additional_discount_account = create_account(
|
||||||
account_name="Discount Account",
|
account_name="Discount Account",
|
||||||
parent_account="Indirect Expenses - _TC",
|
parent_account="Indirect Expenses - _TC",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user