chore(test): fix broken unit test

This commit is contained in:
ruthra kumar 2023-07-17 12:29:42 +05:30
parent f3363e813a
commit 70dd9d0671
2 changed files with 2 additions and 13 deletions

View File

@ -3213,15 +3213,10 @@ class TestSalesInvoice(unittest.TestCase):
account.disabled = 0
account.save()
@change_settings("Accounts Settings", {"unlink_payment_on_cancel_of_invoice": 1})
def test_gain_loss_with_advance_entry(self):
from erpnext.accounts.doctype.journal_entry.test_journal_entry import make_journal_entry
unlink_enabled = frappe.db.get_value(
"Accounts Settings", "Accounts Settings", "unlink_payment_on_cancel_of_invoice"
)
frappe.db.set_single_value("Accounts Settings", "unlink_payment_on_cancel_of_invoice", 1)
jv = make_journal_entry("_Test Receivable USD - _TC", "_Test Bank - _TC", -7000, save=False)
jv.accounts[0].exchange_rate = 70
@ -3264,10 +3259,6 @@ class TestSalesInvoice(unittest.TestCase):
check_gl_entries(self, si.name, expected_gle, nowdate())
frappe.db.set_single_value(
"Accounts Settings", "unlink_payment_on_cancel_of_invoice", unlink_enabled
)
def test_batch_expiry_for_sales_invoice_return(self):
from erpnext.controllers.sales_and_purchase_return import make_return_doc
from erpnext.stock.doctype.item.test_item import make_item

View File

@ -37,6 +37,7 @@ def make_supplier(supplier_name, currency=None):
supplier = frappe.new_doc("Supplier")
supplier.supplier_name = supplier_name
supplier.supplier_type = "Individual"
supplier.supplier_group = "All Supplier Groups"
if currency:
supplier.default_currency = currency
@ -55,9 +56,6 @@ class TestAccountsController(unittest.TestCase):
10 series - Sales Invoice against Payment Entries
20 series - Sales Invoice against Journals
30 series - Sales Invoice against Credit Notes
40 series - Purchase Invoice against Payment Entries
50 series - Purchase Invoice against Journals
60 series - Purchase Invoice against Debit Notes
"""
def setUp(self):