[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
This commit is contained in:
Martin Trigaux
2017-08-03 15:57:36 +02:00
parent ecda057e11
commit 54e4e3156f
@@ -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"""