diff --git a/shopinvader/tests/common.py b/shopinvader/tests/common.py index 7cec4cea82..ae927aea2b 100644 --- a/shopinvader/tests/common.py +++ b/shopinvader/tests/common.py @@ -193,8 +193,8 @@ def setUpClass(cls): ] ) cls.env.user.company_id.currency_id = cls.env.ref("base.USD") - base_price_list = cls.env.ref("product.list0") - base_price_list.currency_id = cls.env.ref("base.USD") + cls.base_pricelist = cls.env.ref("product.list0") + cls.base_pricelist.currency_id = cls.env.ref("base.USD") cls.shopinvader_variant.record_id.currency_id = cls.env.ref("base.USD") diff --git a/shopinvader/tests/test_product.py b/shopinvader/tests/test_product.py index 818f8f2ee3..ea65cde523 100644 --- a/shopinvader/tests/test_product.py +++ b/shopinvader/tests/test_product.py @@ -86,10 +86,11 @@ def test_product_name_url(self): return def test_product_get_price(self): - # base_price_list doesn't define a tax mapping. We are tax included - base_price_list = self.env.ref("product.list0") + # self.base_pricelist doesn't define a tax mapping. We are tax included fiscal_position_fr = self.env.ref("shopinvader.fiscal_position_0") - price = self.shopinvader_variant._get_price(base_price_list, fiscal_position_fr) + price = self.shopinvader_variant._get_price( + self.base_pricelist, fiscal_position_fr + ) self.assertDictEqual( price, { @@ -117,7 +118,7 @@ def test_product_get_price(self): # excluded tax_exclude_fiscal_position = self.env.ref("shopinvader.fiscal_position_1") price = self.shopinvader_variant._get_price( - base_price_list, tax_exclude_fiscal_position + self.base_pricelist, tax_exclude_fiscal_position ) self.assertDictEqual( price, @@ -144,12 +145,13 @@ def test_product_get_price(self): def test_product_get_price_discount_policy(self): # Ensure that discount is with 2 digits self.env.ref("product.decimal_discount").digits = 2 - # base_price_list doesn't define a tax mapping. We are tax included + # self.base_pricelist doesn't define a tax mapping. We are tax included # we modify the discount_policy - base_price_list = self.env.ref("product.list0") - base_price_list.discount_policy = "without_discount" + self.base_pricelist.discount_policy = "without_discount" fiscal_position_fr = self.env.ref("shopinvader.fiscal_position_0") - price = self.shopinvader_variant._get_price(base_price_list, fiscal_position_fr) + price = self.shopinvader_variant._get_price( + self.base_pricelist, fiscal_position_fr + ) self.assertDictEqual( price, { @@ -181,7 +183,7 @@ def test_product_get_price_discount_policy(self): # the original value tax_exclude_fiscal_position = self.env.ref("shopinvader.fiscal_position_1") price = self.shopinvader_variant._get_price( - base_price_list, tax_exclude_fiscal_position + self.base_pricelist, tax_exclude_fiscal_position ) self.assertDictEqual( price,