summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Trigaux <mat@odoo.com>2017-08-03 13:57:19 +0200
committerMartin Trigaux <mat@odoo.com>2017-08-03 15:57:36 +0200
commit54e4e3156f5990a9e58abaad5e051c7ea67aea74 (patch)
tree76dd0d95c7b4ea495eb213f5f2817aad21a32477
parentecda057e1166ea1fa9afa4e5b954e5c99aa80232 (diff)
[FIX] point_of_sale: actually test the flow
Introduced at bb5fd86f The test checked that the invoice amount was the same as the order amount
-rw-r--r--addons/point_of_sale/tests/test_point_of_sale_flow.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/addons/point_of_sale/tests/test_point_of_sale_flow.py b/addons/point_of_sale/tests/test_point_of_sale_flow.py
index 976dbe5c081..7646d0c0c13 100644
--- a/addons/point_of_sale/tests/test_point_of_sale_flow.py
+++ b/addons/point_of_sale/tests/test_point_of_sale_flow.py
@@ -356,12 +356,13 @@ class TestPointOfSaleFlow(TestPointOfSaleCommon):
self.assertFalse(self.pos_order_pos1.invoice_id, 'Invoice should not be attached to order.')
# I generate an invoice from the order
- self.invoice = self.pos_order_pos1.action_pos_order_invoice()
+ res = self.pos_order_pos1.action_pos_order_invoice()
+ self.assertIn('res_id', res, "No invoice created")
# I test that the total of the attached invoice is correct
- self.amount_total = self.pos_order_pos1.amount_total
+ invoice = self.env['account.invoice'].browse(res['res_id'])
self.assertEqual(
- float_compare(self.amount_total, 1752.75, precision_digits=2), 0, "Invoice not correct")
+ float_compare(invoice.amount_total, 1752.75, precision_digits=2), 0, "Invoice not correct")
"""In order to test the reports on Bank Statement defined in point_of_sale module, I create a bank statement line, confirm it and print the reports"""