From cd9a01be5f2aa8593879433a92b9d36a1264b220 Mon Sep 17 00:00:00 2001 From: Rucha Mahabal Date: Mon, 11 Jul 2022 11:57:25 +0530 Subject: [PATCH] test: Loan entries in Bank Reco Statement report --- .../test_bank_reconciliation_statement.py | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 erpnext/accounts/report/bank_reconciliation_statement/test_bank_reconciliation_statement.py diff --git a/erpnext/accounts/report/bank_reconciliation_statement/test_bank_reconciliation_statement.py b/erpnext/accounts/report/bank_reconciliation_statement/test_bank_reconciliation_statement.py new file mode 100644 index 0000000000..d7c871608e --- /dev/null +++ b/erpnext/accounts/report/bank_reconciliation_statement/test_bank_reconciliation_statement.py @@ -0,0 +1,40 @@ +# Copyright (c) 2022, Frappe Technologies Pvt. Ltd. and Contributors +# See license.txt + +import frappe +from frappe.tests.utils import FrappeTestCase + +from erpnext.accounts.doctype.bank_transaction.test_bank_transaction import ( + create_loan_and_repayment, +) +from erpnext.accounts.report.bank_reconciliation_statement.bank_reconciliation_statement import ( + execute, +) +from erpnext.loan_management.doctype.loan.test_loan import create_loan_accounts + + +class TestBankReconciliationStatement(FrappeTestCase): + def setUp(self): + for dt in [ + "Loan Repayment", + "Loan Disbursement", + "Journal Entry", + "Journal Entry Account", + "Payment Entry", + ]: + frappe.db.delete(dt) + + def test_loan_entries_in_bank_reco_statement(self): + create_loan_accounts() + repayment_entry = create_loan_and_repayment() + + filters = frappe._dict( + { + "company": "Test Company", + "account": "Payment Account - _TC", + "report_date": "2018-10-30", + } + ) + result = execute(filters) + + self.assertEqual(result[1][0].payment_entry, repayment_entry.name)