[FIX] utm,product: Make tests demo data independent

Part-of: odoo/odoo#146649
This commit is contained in:
Yannick Tivisse
2023-12-18 23:32:05 +00:00
parent 7466ecd400
commit 478146f80e
4 changed files with 7 additions and 1 deletions
+3
View File
@@ -18,6 +18,9 @@ class ProductCommon(
def setUpClass(cls):
super().setUpClass()
cls.env.company.currency_id = cls.env.ref('base.USD')
cls.currency = cls.env.ref('base.USD')
# Ideally, this logic should be moved into sthg like a NoAccountCommon in account :D
# Since tax fields are specified in account module, cannot be given as create values
NO_TAXES_CONTEXT = {
@@ -19,6 +19,7 @@ class TestProductAttributeValueCommon(TransactionCase):
super().setUpClass()
cls.env = cls.env['base'].with_context(**DISABLED_MAIL_CONTEXT).env
cls.env.company.country_id = cls.env.ref('base.us')
cls.computer = cls.env['product.template'].create({
'name': 'Super Computer',
+1
View File
@@ -227,6 +227,7 @@ class TestVirtualAvailable(TestStockCommon):
calling `name_search` with a negative operator will exclude T from the
result.
"""
self.env.ref('base.group_user').write({'implied_ids': [(4, self.env.ref('product.group_product_variant').id)]})
template = self.env['product.template'].create({
'name': 'Super Product',
})
+2 -1
View File
@@ -2,10 +2,11 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import odoo.tests
from odoo.addons.base.tests.common import HttpCaseWithUserDemo
@odoo.tests.tagged('post_install', '-at_install')
class TestRoutes(odoo.tests.HttpCase):
class TestRoutes(HttpCaseWithUserDemo):
def test_01_web_session_destroy(self):
base_url = self.env['ir.config_parameter'].sudo().get_param('web.base.url')