Skip to content

Commit

Permalink
fix 🔧 resolve tests failing
Browse files Browse the repository at this point in the history
  • Loading branch information
samar-hassan committed Feb 15, 2024
1 parent 76e5d6c commit 275b30b
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions tests/reverse/test_catalogue.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ def test_create_product_with_related_fields(self):

def test_create_productclass_with_product(self):
partner = Partner.objects.get(name="klaas")
product_class = ProductClassResource(slug="klaas", name="Klaas")

product_resource = ProductResource(
upc="1234323-2",
Expand All @@ -178,7 +179,7 @@ def test_create_productclass_with_product(self):
availability=2,
currency="EUR",
partner=partner,
product_class=ProductClassResource(slug="klaas"),
product_class=product_class,
images=[
ImageResource(
caption="gekke caption",
Expand Down Expand Up @@ -216,12 +217,13 @@ def test_create_productclass_with_product(self):
self.assertEqual(prd.images.count(), 2)

def test_resource_default_value(self):
product_class = ProductClassResource(slug="klaas", name="Klaas")
product_resource = ProductResource(
upc="1234",
title="bat",
slug="asdf",
structure=Product.STANDALONE,
product_class=ProductClassResource(slug="klaas"),
product_class=product_class,
is_discountable=False,
)
_, errors = products_to_db(product_resource)
Expand All @@ -234,7 +236,7 @@ def test_resource_default_value(self):
title="bat",
slug="asdf",
structure=Product.STANDALONE,
product_class=ProductClassResource(slug="klaas"),
product_class=product_class,
)
_, errors = products_to_db(product_resource)
self.assertEqual(len(errors), 0)
Expand All @@ -244,6 +246,7 @@ def test_resource_default_value(self):

def test_idempotent(self):
partner = Partner.objects.get(name="klaas")
product_class = ProductClassResource(slug="klaas", name="Klaas")

product_resource = ProductResource(
upc="1234323-2",
Expand All @@ -256,7 +259,7 @@ def test_idempotent(self):
availability=2,
currency="EUR",
partner=partner,
product_class=ProductClassResource(slug="klaas"),
product_class=product_class,
images=[
ImageResource(
caption="gekke caption",
Expand Down Expand Up @@ -306,7 +309,7 @@ def test_idempotent(self):
availability=2,
currency="EUR",
partner=partner,
product_class=ProductClassResource(slug="klaas"),
product_class=product_class,
images=[
ImageResource(
caption="gekke caption",
Expand Down Expand Up @@ -373,6 +376,7 @@ def image(self):
return output

def test_create_simple_product(self):
product_class = ProductClassResource(slug="klaas", name="Klaas")
product_resources = [
ProductResource(
upc="1234323asd",
Expand All @@ -381,7 +385,7 @@ def test_create_simple_product(self):
description="description",
structure=Product.STANDALONE,
is_discountable=True,
product_class=ProductClassResource(slug="klaas"),
product_class=product_class,
),
ProductResource(
upc="1234323-2",
Expand All @@ -390,7 +394,7 @@ def test_create_simple_product(self):
description="description",
structure=Product.STANDALONE,
is_discountable=True,
product_class=ProductClassResource(slug="klaas"),
product_class=product_class,
),
]

Expand Down

0 comments on commit 275b30b

Please sign in to comment.