Skip to content

Commit

Permalink
[MIG] 18.0 packaging_uom
Browse files Browse the repository at this point in the history
  • Loading branch information
gaelTorrecillas committed Jan 15, 2025
1 parent 4eb9333 commit 8b960a4
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions packaging_uom/tests/test_product_packaging.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@
from odoo.addons.base.tests.common import SavepointCaseWithUserDemo


class TestProductPackaging(SavepointCaseWithUserDemo):
class TestProductPackaging(TransactionCase):
@classmethod
def setUpClass(cls):
super().setUpClass()
cls.env = cls.env(context=dict(cls.env.context, tracking_disable=True))
cls.packaging_obj = cls.env["product.packaging"]
cls.uom_obj = cls.env["uom.uom"]
cls.uom_unit = cls.env.ref("uom.product_uom_unit")
cls.uom_dozen = cls.env.ref("uom.product_uom_dozen")
cls.product_dozen = cls.env["product.product"].create(
Expand Down Expand Up @@ -65,7 +66,7 @@ def test_compute_quantity_by_package(self):
product_packaging_unit.uom_categ_domain_id,
"The UOM domain is not well set",
)
product_uom_24 = self.env["uom.uom"].create(
product_uom_24 = self.uom_obj.create(
{
"category_id": self.env.ref("uom.product_uom_categ_unit").id,
"name": "Double Dozens",
Expand All @@ -77,7 +78,7 @@ def test_compute_quantity_by_package(self):
self.assertAlmostEqual(product_packaging_dozen.qty, 0.5)
product_packaging_unit.uom_id = product_uom_24
self.assertAlmostEqual(product_packaging_unit.qty, 24)
product_uom_6 = self.env["uom.uom"].create(
product_uom_6 = self.uom_obj.create(
{
"category_id": self.env.ref("uom.product_uom_categ_unit").id,
"name": "Demi Dozens",
Expand All @@ -97,7 +98,7 @@ def test_compute_quantity_by_package(self):
product_packaging_dozen.uom_id = None

# Define a new packaging unit
uom_524 = self.env["uom.uom"].search(
uom_524 = self.uom_obj.search(
[
(
"category_id",
Expand Down

0 comments on commit 8b960a4

Please sign in to comment.