diff --git a/addons/sale_coupon/tests/common.py b/addons/sale_coupon/tests/common.py index 03820578f64..fec5d669aba 100644 --- a/addons/sale_coupon/tests/common.py +++ b/addons/sale_coupon/tests/common.py @@ -1,14 +1,19 @@ # -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. -from openerp.tests import common +from odoo.addons.sale.tests.test_sale_product_attribute_value_config import TestSaleProductAttributeValueSetup -class TestSaleCouponCommon(common.TransactionCase): +class TestSaleCouponCommon(TestSaleProductAttributeValueSetup): def setUp(self): super(TestSaleCouponCommon, self).setUp() + # set currency to not rely on demo data and avoid possible race condition + self.currency_ratio = 1.0 + pricelist = self.env.ref('product.list0') + pricelist.currency_id = self._setup_currency(self.currency_ratio) + # Set all the existing programs to active=False to avoid interference self.env['sale.coupon.program'].search([]).write({'active': False}) diff --git a/addons/website_sale_coupon/tests/test_shop_sale_coupon.py b/addons/website_sale_coupon/tests/test_shop_sale_coupon.py index 1ab113c83a8..4910d95f827 100644 --- a/addons/website_sale_coupon/tests/test_shop_sale_coupon.py +++ b/addons/website_sale_coupon/tests/test_shop_sale_coupon.py @@ -1,14 +1,23 @@ # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo.tests import HttpCase, tagged +from odoo.addons.sale.tests.test_sale_product_attribute_value_config import TestSaleProductAttributeValueSetup @tagged('post_install', '-at_install') -class TestUi(HttpCase): +class TestUi(TestSaleProductAttributeValueSetup, HttpCase): post_install = True at_install = False + def setUp(self): + super(TestUi, self).setUp() + + # set currency to not rely on demo data and avoid possible race condition + self.currency_ratio = 1.0 + pricelist = self.env.ref('product.list0') + pricelist.currency_id = self._setup_currency(self.currency_ratio) + def test_01_admin_shop_sale_coupon_tour(self): # pre enable "Show # found" option to avoid race condition... self.env.ref("website_sale.search count").write({"active": True})