summaryrefslogtreecommitdiff
path: root/addons/account_check_printing/tests
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2019-04-11 17:24:25 +0200
committerChristophe Simonis <chs@odoo.com>2019-04-11 17:24:25 +0200
commite7a0d82c3ce579321affe95c5051bac3a9e9f511 (patch)
treeee539fcf43cd3f793ee15f122c49c34318d172ae /addons/account_check_printing/tests
parent36d4c9982810642c12d371b4420e9a9bee5c5eed (diff)
[FIX] account_check_printing: correct test
Since 491deeb3d4227557b15e31b4a8e93022ebb4ff90, only check related to reconciled invoices are printed. Adapt test to take it into account.
Diffstat (limited to 'addons/account_check_printing/tests')
-rw-r--r--addons/account_check_printing/tests/test_print_check.py4
1 files 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)