test: Fixes in test case

This commit is contained in:
Deepesh Garg 2022-04-23 12:08:30 +05:30
parent 8a8476bb5c
commit 0eacc99ab7

View File

@ -30,16 +30,22 @@ class TestBankClearance(unittest.TestCase):
payment_entry = frappe.get_doc(
"Payment Entry", {"party_name": "_Test Supplier", "paid_from": "_Test Bank Clearance - _TC"}
)
if payment_entry.docstatus == 1:
payment_entry.cancel()
payment_entry.delete()
loan = frappe.get_doc("Loan", {"applicant": "_Test Customer"})
ld_doc = frappe.get_doc("Loan Disbursement", {"against_loan": loan.name})
if ld_doc.docstatus == 1:
ld_doc.cancel()
ld_doc.delete()
lr_doc = frappe.get_doc("Loan Repayment", {"against_loan": loan.name})
if lr_doc.docstatus == 1:
lr_doc.cancel()
lr_doc.delete()
@ -47,6 +53,8 @@ class TestBankClearance(unittest.TestCase):
lia.delete()
plia = frappe.get_doc("Process Loan Interest Accrual", {"loan": loan.name})
if plia.docstatus == 1:
plia.cancel()
plia.delete()