Skip to content

Commit

Permalink
[IMP] purchase_discount: test performance improvement
Browse files Browse the repository at this point in the history
- Include context keys for avoiding mail operations overhead.
  • Loading branch information
josep-tecnativa committed Oct 30, 2023
1 parent 84ad7dd commit f4e3409
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions purchase_discount/tests/test_product_supplierinfo_discount.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,14 @@
from odoo import fields
from odoo.tests.common import Form, TransactionCase

from odoo.addons.base.tests.common import DISABLED_MAIL_CONTEXT


class TestProductSupplierinfoDiscount(TransactionCase):
@classmethod
def setUpClass(cls):
super().setUpClass()
cls.env = cls.env(context=dict(cls.env.context, **DISABLED_MAIL_CONTEXT))
cls.supplierinfo_model = cls.env["product.supplierinfo"]
cls.purchase_order_line_model = cls.env["purchase.order.line"]
cls.partner_1 = cls.env.ref("base.res_partner_1")
Expand Down
3 changes: 3 additions & 0 deletions purchase_discount/tests/test_purchase_discount.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,14 @@
from odoo import fields
from odoo.tests.common import Form, TransactionCase

from odoo.addons.base.tests.common import DISABLED_MAIL_CONTEXT


class TestPurchaseOrder(TransactionCase):
@classmethod
def setUpClass(cls):
super(TestPurchaseOrder, cls).setUpClass()
cls.env = cls.env(context=dict(cls.env.context, **DISABLED_MAIL_CONTEXT))
cls.categ_cost_average = cls.env["product.category"].create(
{"name": "Average cost method category", "property_cost_method": "average"}
)
Expand Down

0 comments on commit f4e3409

Please sign in to comment.