Skip to content

Commit

Permalink
refactor(test): make use of @change_settings in PI test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
ruthra-kumar committed Oct 15, 2023
1 parent a2e064d commit 0207d6e
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,7 @@ def test_purchase_invoice_calculation(self):
self.assertEqual(tax.tax_amount, expected_values[i][1])
self.assertEqual(tax.total, expected_values[i][2])

@change_settings("Accounts Settings", {"unlink_payment_on_cancellation_of_invoice": 1})
def test_purchase_invoice_with_advance(self):
from erpnext.accounts.doctype.journal_entry.test_journal_entry import (
test_records as jv_test_records,
Expand Down Expand Up @@ -479,6 +480,7 @@ def test_purchase_invoice_with_advance(self):
)
)

@change_settings("Accounts Settings", {"unlink_payment_on_cancellation_of_invoice": 1})
def test_invoice_with_advance_and_multi_payment_terms(self):
from erpnext.accounts.doctype.journal_entry.test_journal_entry import (
test_records as jv_test_records,
Expand Down Expand Up @@ -1223,6 +1225,7 @@ def test_deferred_expense_via_journal_entry(self):
acc_settings.submit_journal_entriessubmit_journal_entries = 0
acc_settings.save()

@change_settings("Accounts Settings", {"unlink_payment_on_cancellation_of_invoice": 1})
def test_gain_loss_with_advance_entry(self):
unlink_enabled = frappe.db.get_value(
"Accounts Settings", "Accounts Settings", "unlink_payment_on_cancel_of_invoice"
Expand Down Expand Up @@ -1423,6 +1426,7 @@ def test_gain_loss_with_advance_entry(self):
)
frappe.db.set_value("Company", "_Test Company", "exchange_gain_loss_account", original_account)

@change_settings("Accounts Settings", {"unlink_payment_on_cancellation_of_invoice": 1})
def test_purchase_invoice_advance_taxes(self):
from erpnext.accounts.doctype.payment_entry.payment_entry import get_payment_entry

Expand Down

0 comments on commit 0207d6e

Please sign in to comment.