Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Use already established fixture

Adam Janikba9f63b1bceb
diff --git a/tests/conftest.py b/tests/conftest.py
index f2f592fd88..027a0c1797 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -642,16 +642,3 @@ def closed_orders(billing_address):
def collection(db):
collection = Collection.objects.create(name='Collection', slug='collection')
return collection
-
-
-def product(product_type, default_category):
- product_attr = product_type.product_attributes.first()
- attr_value = product_attr.values.first()
- attributes = {smart_text(product_attr.pk): smart_text(attr_value.pk)}
-
- product = Product.objects.create(
- name='Test product 1', price=Decimal('10.00'),
- product_type=product_type, attributes=attributes, is_published=True,
- category=default_category)
- return product
diff --git a/tests/test_product.py b/tests/test_product.py
index 8d4e7c3f4b..269e9c6e2b 100644
--- a/tests/test_product.py
+++ b/tests/test_product.py
@@ -519,9 +519,10 @@ def test_render_product_page_with_no_variant(
def test_include_products_from_subcategories_in_main_view(
- default_category, product, authorized_client):
+ default_category, product_in_stock, authorized_client):
subcategory = Category.objects.create(
name='sub', slug='test', parent=default_category)
+ product = product_in_stock
product.category = subcategory
product.save()
path = default_category.get_full_path()