From e7a0d82c3ce579321affe95c5051bac3a9e9f511 Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Thu, 11 Apr 2019 17:24:25 +0200 Subject: [PATCH] [FIX] account_check_printing: correct test Since 491deeb3d4227557b15e31b4a8e93022ebb4ff90, only check related to reconciled invoices are printed. Adapt test to take it into account. --- addons/account_check_printing/tests/test_print_check.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/account_check_printing/tests/test_print_check.py b/addons/account_check_printing/tests/test_print_check.py index 62957701be4..a14a168d9a4 100644 --- a/addons/account_check_printing/tests/test_print_check.py +++ b/addons/account_check_printing/tests/test_print_check.py @@ -61,7 +61,7 @@ class TestPrintCheck(AccountingTestCase): def test_print_check(self): # Make a payment for 10 invoices and 5 credit notes invoices = self.env['account.invoice'] - for i in range(0, 15): + for i in range(0, 42): invoices |= self.create_invoice(is_refund=(i % 3 == 0)) payment = self.create_payment(invoices) self.assertEqual(all(payment.mapped('check_amount_in_words')), True, 'The amount in words is not set on all the payments') @@ -70,7 +70,7 @@ class TestPrintCheck(AccountingTestCase): # Check the data generated for the report self.env.ref('base.main_company').write({'account_check_printing_multi_stub': True}) report_pages = payment._check_get_pages() - self.assertEqual(len(report_pages), int(math.ceil(len(invoices.ids) / INV_LINES_PER_STUB))) + self.assertEqual(len(report_pages), int(math.ceil(len(payment.reconciled_invoice_ids) / INV_LINES_PER_STUB))) self.env.ref('base.main_company').write({'account_check_printing_multi_stub': False}) report_pages = payment._check_get_pages() self.assertEqual(len(report_pages), 1)