Skip to content

Commit 13ee5ea

Browse files
[FIX] Force tax on test products
This aims to avoid having a different tax depending on which localization is installed for instance
1 parent 4f34a2d commit 13ee5ea

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

account_ecotax_sale/tests/test_sale_ecotax.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# @author Mourad EL HADJ MIMOUNE <[email protected]>
33
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
44

5+
from odoo import Command
56
from odoo.tests.common import Form
67

78
from odoo.addons.account_ecotax.tests.test_ecotax import TestInvoiceEcotaxCommon
@@ -16,6 +17,7 @@ def setUpClass(cls):
1617
"name": "product_a",
1718
"uom_id": cls.env.ref("uom.product_uom_unit").id,
1819
"weight": 100,
20+
"taxes_id": [Command.set(cls.invoice_tax.ids)],
1921
"list_price": 200,
2022
}
2123
)
@@ -24,6 +26,7 @@ def setUpClass(cls):
2426
"name": "product_b",
2527
"uom_id": cls.env.ref("uom.product_uom_unit").id,
2628
"list_price": 200,
29+
"taxes_id": [Command.set(cls.invoice_tax.ids)],
2730
"weight": 400,
2831
}
2932
)

account_ecotax_sale_tax/tests/test_sale_ecotax.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def test_01_classification_weight_based_ecotax(self):
2929
so_form.save()
3030
self.assertEqual(self.sale.order_line.ecotax_amount_unit, 16)
3131
self.assertEqual(self.sale.order_line.subtotal_ecotax, 48)
32-
self.assertEqual(self.sale.amount_total, 648)
32+
self.assertEqual(self.sale.amount_total, 712.8)
3333
self.assertEqual(self.sale.amount_ecotax, 48)
3434

3535
def test_02_classification_ecotax(self):
@@ -56,5 +56,5 @@ def test_02_classification_ecotax(self):
5656
self.assertAlmostEqual(sale_line1.subtotal_ecotax, 15.0)
5757
self.assertEqual(sale_line2.ecotax_amount_unit, 16)
5858
self.assertEqual(sale_line2.subtotal_ecotax, 32)
59-
self.assertEqual(self.sale.amount_total, 1047.0)
59+
self.assertEqual(self.sale.amount_total, 1151.7)
6060
self.assertEqual(self.sale.amount_ecotax, 47.0)

0 commit comments

Comments
 (0)