diff --git a/addons/point_of_sale/tests/test_pos_products_with_tax.py b/addons/point_of_sale/tests/test_pos_products_with_tax.py index c03efcaaca6a376fb234fea5ee249c932624712b..54966ecaf5327134d52393ca32f43c4c29e443f6 100644 --- a/addons/point_of_sale/tests/test_pos_products_with_tax.py +++ b/addons/point_of_sale/tests/test_pos_products_with_tax.py @@ -77,7 +77,7 @@ class TestPoSProductsWithTax(TestPoSCommon): # check values before closing the session self.assertEqual(3, self.pos_session.order_count) orders_total = sum(order.amount_total for order in self.pos_session.order_ids) - self.assertAlmostEqual(orders_total, self.pos_session.total_payments_amount, 'Total order amount should be equal to the total payment amount.') + self.assertAlmostEqual(orders_total, self.pos_session.total_payments_amount, msg='Total order amount should be equal to the total payment amount.') self._run_test({ 'payment_methods': self.cash_pm1 | self.bank_pm1, diff --git a/addons/purchase_stock/tests/test_anglo_saxon_valuation_reconciliation.py b/addons/purchase_stock/tests/test_anglo_saxon_valuation_reconciliation.py index cbb7e54ca5665ac79ea77bb9dffad2f763f1aafd..ef005a2cc03b56ee22e826e0274220b3165a8825 100644 --- a/addons/purchase_stock/tests/test_anglo_saxon_valuation_reconciliation.py +++ b/addons/purchase_stock/tests/test_anglo_saxon_valuation_reconciliation.py @@ -330,7 +330,7 @@ class TestValuationReconciliation(ValuationReconciliationTestCommon): exchange_move = valuation_line.full_reconcile_id.exchange_move_id self.assertTrue(exchange_move, "An exchange move should exists.") exchange_difference = exchange_move.line_ids.filtered(lambda l: l.account_id.id == interim_account_id).balance - self.assertAlmostEqual(exchange_difference, 38.46, "Exchange amount is incorrect") + self.assertAlmostEqual(exchange_difference, 38.46, msg="Exchange amount is incorrect") def test_reconcile_cash_basis_bill(self): ''' Test the generation of the CABA move after bill payment diff --git a/addons/purchase_stock/tests/test_stockvaluation.py b/addons/purchase_stock/tests/test_stockvaluation.py index 50b03f519314565585b4ce7d98d89b3137b19e5e..7a6ec114ba0f74dbd44c2d40aca3544b2705e602 100644 --- a/addons/purchase_stock/tests/test_stockvaluation.py +++ b/addons/purchase_stock/tests/test_stockvaluation.py @@ -479,16 +479,16 @@ class TestStockValuationWithCOA(AccountTestInvoicingCommon): # Check what was posted in the price difference account price_diff_aml = self.env['account.move.line'].search([('account_id','=', self.price_diff_account.id)]) self.assertEqual(len(price_diff_aml), 1, "Only one line should have been generated in the price difference account.") - self.assertAlmostEqual(price_diff_aml.debit, 5, "Price difference should be equal to 5 (15-10)") + self.assertAlmostEqual(price_diff_aml.debit, 5, msg="Price difference should be equal to 5 (15-10)") # Check what was posted in stock input account input_aml = self.env['account.move.line'].search([('account_id','=',self.stock_input_account.id)]) self.assertEqual(len(input_aml), 3, "Only three lines should have been generated in stock input account: one when receiving the product, one when making the invoice.") invoice_amls = input_aml.filtered(lambda l: l.move_id == invoice) picking_aml = input_aml - invoice_amls - self.assertAlmostEqual(sum(invoice_amls.mapped('debit')), 15, "Total debit value on stock input account should be equal to the original PO price of the product.") - self.assertAlmostEqual(sum(invoice_amls.mapped('credit')), 5, "Total debit value on stock input account should be equal to the original PO price of the product.") - self.assertAlmostEqual(sum(picking_aml.mapped('credit')), 10, "Total credit value on stock input account should be equal to the original PO price of the product.") + self.assertAlmostEqual(sum(invoice_amls.mapped('debit')), 15, msg="Total debit value on stock input account should be equal to the original PO price of the product.") + self.assertAlmostEqual(sum(invoice_amls.mapped('credit')), 5, msg="Total debit value on stock input account should be equal to the original PO price of the product.") + self.assertAlmostEqual(sum(picking_aml.mapped('credit')), 10, msg="Total credit value on stock input account should be equal to the original PO price of the product.") def test_valuation_from_increasing_tax(self): """ Check that a tax without account will increment the stock value. @@ -607,14 +607,14 @@ class TestStockValuationWithCOA(AccountTestInvoicingCommon): diff_aml = invoice_amls - payable_aml # check USD - self.assertAlmostEqual(payable_aml.debit, 50, "Total debit value should be equal to the original PO price of the product.") - self.assertAlmostEqual(picking_aml.credit, 10, "credit value for stock should be equal to the standard price of the product.") - self.assertAlmostEqual(diff_aml.credit, 40, "credit value for price difference") + self.assertAlmostEqual(payable_aml.debit, 50, msg="Total debit value should be equal to the original PO price of the product.") + self.assertAlmostEqual(picking_aml.credit, 10, msg="credit value for stock should be equal to the standard price of the product.") + self.assertAlmostEqual(diff_aml.credit, 40, msg="credit value for price difference") # check EUR - self.assertAlmostEqual(payable_aml.amount_currency, 100, "Total debit value should be equal to the original PO price of the product.") - self.assertAlmostEqual(picking_aml.amount_currency, -20, "credit value for stock should be equal to the standard price of the product.") - self.assertAlmostEqual(diff_aml.amount_currency, -80, "credit value for price difference") + self.assertAlmostEqual(payable_aml.amount_currency, 100, msg="Total debit value should be equal to the original PO price of the product.") + self.assertAlmostEqual(picking_aml.amount_currency, -20, msg="credit value for stock should be equal to the standard price of the product.") + self.assertAlmostEqual(diff_aml.amount_currency, -80, msg="credit value for price difference") def test_valuation_multicurecny_with_tax(self): """ Check that a tax without account will increment the stock value. @@ -705,8 +705,8 @@ class TestStockValuationWithCOA(AccountTestInvoicingCommon): picking_aml = input_amls - invoice_aml # check EUR - self.assertAlmostEqual(invoice_aml.amount_currency, 100, "Total debit value should be equal to the original PO price of the product.") - self.assertAlmostEqual(picking_aml.amount_currency, -95, "credit value for stock should be equal to the untaxed price of the product.") + self.assertAlmostEqual(invoice_aml.amount_currency, 100, msg="Total debit value should be equal to the original PO price of the product.") + self.assertAlmostEqual(picking_aml.amount_currency, -95, msg="credit value for stock should be equal to the untaxed price of the product.") def test_average_realtime_anglo_saxon_valuation_multicurrency_same_date(self): """ @@ -1409,13 +1409,13 @@ class TestStockValuationWithCOA(AccountTestInvoicingCommon): # Check what was posted in the price difference account price_diff_aml = self.env['account.move.line'].search([('account_id','=', self.price_diff_account.id)]) self.assertEqual(len(price_diff_aml), 1, "Only one line should have been generated in the price difference account.") - self.assertAlmostEqual(price_diff_aml.credit, 20, "Price difference should be equal to 20 (110-90)") + self.assertAlmostEqual(price_diff_aml.credit, 20, msg="Price difference should be equal to 20 (110-90)") # Check what was posted in stock input account input_aml = self.env['account.move.line'].search([('account_id','=', self.stock_input_account.id)]) self.assertEqual(len(input_aml), 3, "Only two lines should have been generated in stock input account: one when receiving the product, two when making the invoice.") - self.assertAlmostEqual(sum(input_aml.mapped('debit')), 110, "Total debit value on stock input account should be equal to the original PO price of the product.") - self.assertAlmostEqual(sum(input_aml.mapped('credit')), 110, "Total credit value on stock input account should be equal to the original PO price of the product.") + self.assertAlmostEqual(sum(input_aml.mapped('debit')), 110, msg="Total debit value on stock input account should be equal to the original PO price of the product.") + self.assertAlmostEqual(sum(input_aml.mapped('credit')), 110, msg="Total credit value on stock input account should be equal to the original PO price of the product.") def test_anglosaxon_valuation_discount(self): """ @@ -1456,13 +1456,13 @@ class TestStockValuationWithCOA(AccountTestInvoicingCommon): # Check what was posted in the price difference account price_diff_aml = self.env['account.move.line'].search([('account_id', '=', self.price_diff_account.id)]) self.assertEqual(len(price_diff_aml), 1, "Only one line should have been generated in the price difference account.") - self.assertAlmostEqual(price_diff_aml.credit, 10, "Price difference should be equal to 10 (100-90)") + self.assertAlmostEqual(price_diff_aml.credit, 10, msg="Price difference should be equal to 10 (100-90)") # Check what was posted in stock input account input_aml = self.env['account.move.line'].search([('account_id', '=', self.stock_input_account.id)]) self.assertEqual(len(input_aml), 3, "Three lines generated in stock input account: one when receiving the product, two when making the invoice.") - self.assertAlmostEqual(sum(input_aml.mapped('debit')), 100, "Total debit value on stock input account should be equal to the original PO price of the product.") - self.assertAlmostEqual(sum(input_aml.mapped('credit')), 100, "Total credit value on stock input account should be equal to the original PO price of the product.") + self.assertAlmostEqual(sum(input_aml.mapped('debit')), 100, msg="Total debit value on stock input account should be equal to the original PO price of the product.") + self.assertAlmostEqual(sum(input_aml.mapped('credit')), 100, msg="Total credit value on stock input account should be equal to the original PO price of the product.") def test_anglosaxon_valuation_price_unit_diff_discount(self): """ @@ -1507,8 +1507,8 @@ class TestStockValuationWithCOA(AccountTestInvoicingCommon): # Check what was posted in stock input account input_aml = self.env['account.move.line'].search([('account_id','=', self.stock_input_account.id)]) self.assertEqual(len(input_aml), 2, "Only two lines should have been generated in stock input account: one when receiving the product, one when making the invoice.") - self.assertAlmostEqual(sum(input_aml.mapped('debit')), 90, "Total debit value on stock input account should be equal to the original PO price of the product.") - self.assertAlmostEqual(sum(input_aml.mapped('credit')), 90, "Total credit value on stock input account should be equal to the original PO price of the product.") + self.assertAlmostEqual(sum(input_aml.mapped('debit')), 90, msg="Total debit value on stock input account should be equal to the original PO price of the product.") + self.assertAlmostEqual(sum(input_aml.mapped('credit')), 90, msg="Total credit value on stock input account should be equal to the original PO price of the product.") def test_anglosaxon_valuation_price_unit_diff_avco(self): """ diff --git a/addons/sale_mrp/tests/test_sale_mrp_kit_bom.py b/addons/sale_mrp/tests/test_sale_mrp_kit_bom.py index 23a97af0dae3e92730475f82a317367598c8cbbe..f6981b6666263ef14d6c34cd77c5a68344abdd70 100644 --- a/addons/sale_mrp/tests/test_sale_mrp_kit_bom.py +++ b/addons/sale_mrp/tests/test_sale_mrp_kit_bom.py @@ -162,9 +162,9 @@ class TestSaleMrpKitBom(TransactionCase): self.assertEqual(len(amls), 4) stock_out_aml = amls.filtered(lambda aml: aml.account_id == self.stock_output_account) self.assertEqual(stock_out_aml.debit, 0) - self.assertAlmostEqual(stock_out_aml.credit, 1.53, "Should not include the value of consumable component") + self.assertAlmostEqual(stock_out_aml.credit, 1.53, msg="Should not include the value of consumable component") cogs_aml = amls.filtered(lambda aml: aml.account_id == self.expense_account) - self.assertAlmostEqual(cogs_aml.debit, 1.53, "Should not include the value of consumable component") + self.assertAlmostEqual(cogs_aml.debit, 1.53, msg="Should not include the value of consumable component") self.assertEqual(cogs_aml.credit, 0) def test_reset_avco_kit(self):