Skip to content

Commit

Permalink
Merge PR #897 into 14.0
Browse files Browse the repository at this point in the history
Signed-off-by rousseldenis
  • Loading branch information
shopinvader-git-bot committed Mar 26, 2021
2 parents e1452b6 + 8f4b6b2 commit 611be78
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
4 changes: 2 additions & 2 deletions shopinvader/tests/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")


Expand Down
20 changes: 11 additions & 9 deletions shopinvader/tests/test_product.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
{
Expand Down Expand Up @@ -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,
Expand All @@ -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,
{
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 611be78

Please sign in to comment.