Skip to content

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

Fix usage of a wrong fixture in "test_attributes_in_collection_query"

Mateusz Dereniowski51cef980f992
diff --git a/tests/api/test_attributes.py b/tests/api/test_attributes.py
index b30122bed4..f9fd5ff8e4 100644
--- a/tests/api/test_attributes.py
+++ b/tests/api/test_attributes.py
@@ -401,8 +401,10 @@ def test_attributes_in_category_query(user_api_client, product):
assert len(attributes_data) == Attribute.objects.count()
-def test_attributes_in_collection_query(user_api_client, sale):
- product_types = set(sale.products.all().values_list("product_type_id", flat=True))
+def test_attributes_in_collection_query(user_api_client, collection):
+ product_types = set(
+ collection.products.all().values_list("product_type_id", flat=True)
+ )
expected_attrs = Attribute.objects.filter(
Q(attributeproduct__product_type_id__in=product_types)
| Q(attributevariant__product_type_id__in=product_types)
@@ -421,7 +423,7 @@ def test_attributes_in_collection_query(user_api_client, sale):
}
}
""" % {
- "collection_id": graphene.Node.to_global_id("Collection", sale.id)
+ "collection_id": graphene.Node.to_global_id("Collection", collection.pk)
}
response = user_api_client.post_graphql(query)
content = get_graphql_content(response)