Skip to content

Commit

Permalink
Add an extra test
Browse files Browse the repository at this point in the history
  • Loading branch information
raphodn committed Nov 7, 2024
1 parent e1f919b commit a933048
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions open_prices/prices/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,12 @@ def test_price_without_product_validation(self):
cm.exception.messages[0],
"Invalid value: 'test', expected value to be in 'lang:tag' format",
)
PriceFactory(
product_code=None,
category_tag="fr: Grenoble", # valid (even if not in the taxonomy)
price=3,
price_per=price_constants.PRICE_PER_KILOGRAM,
)
PriceFactory(
product_code=None,
category_tag="en:tomatoes",
Expand All @@ -131,7 +137,7 @@ def test_price_without_product_validation(self):
PriceFactory,
product_code=None,
category_tag="en:tomatoes",
labels_tags="en:organic",
labels_tags="en:organic", # should be a list
price=3,
price_per=price_constants.PRICE_PER_KILOGRAM,
)
Expand All @@ -140,7 +146,7 @@ def test_price_without_product_validation(self):
PriceFactory,
product_code=None,
category_tag="en:tomatoes",
labels_tags=["en:organic", "test"],
labels_tags=["en:organic", "test"], # not valid
price=3,
price_per=price_constants.PRICE_PER_KILOGRAM,
)
Expand All @@ -158,7 +164,7 @@ def test_price_without_product_validation(self):
product_code=None,
category_tag="en:tomatoes",
labels_tags=["en:organic"],
origins_tags="en:france",
origins_tags="en:france", # should be a list
price=3,
price_per=price_constants.PRICE_PER_KILOGRAM,
)
Expand All @@ -168,7 +174,7 @@ def test_price_without_product_validation(self):
product_code=None,
category_tag="en:tomatoes",
labels_tags=["en:organic"],
origins_tags=["en:france", "test"],
origins_tags=["en:france", "test"], # not valid
price=3,
price_per=price_constants.PRICE_PER_KILOGRAM,
)
Expand Down

0 comments on commit a933048

Please sign in to comment.