Skip to content

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

Fix test

Adam Janikfff577ac7085
diff --git a/saleor/graphql/api.py b/saleor/graphql/api.py
index f8f450784e..4c02b7ca73 100644
--- a/saleor/graphql/api.py
+++ b/saleor/graphql/api.py
@@ -42,7 +42,6 @@ class Query(graphene.ObjectType):
description='Lookup a page by ID or by slug.')
pages = DjangoFilterConnectionField(
Page, filterset_class=DistinctFilterSet,
- level=graphene.Argument(graphene.Int),
description='List of the shop\'s pages.')
product = graphene.Field(
Product, id=graphene.Argument(graphene.ID),
diff --git a/tests/api/test_product.py b/tests/api/test_product.py
index 78df6424da..674df692bd 100644
--- a/tests/api/test_product.py
+++ b/tests/api/test_product.py
@@ -386,8 +386,12 @@ def test_create_product(
name
}
attributes{
- name
- value
+ attribute{
+ slug
+ }
+ attributeValue{
+ slug
+ }
}
}
errors {
@@ -450,8 +454,8 @@ def test_create_product(
assert data['product']['productType']['name'] == product_type.name
assert data['product']['category']['name'] == default_category.name
values = (
- data['product']['attributes'][0].get('value'),
- data['product']['attributes'][1].get('value'))
+ data['product']['attributes'][0]['attributeValue']['slug'],
+ data['product']['attributes'][1]['attributeValue']['slug'])
assert slugify(non_existent_attr_value) in values
assert color_value_slug in values
@@ -499,8 +503,12 @@ def test_update_product(
name
}
attributes{
- name
- value
+ attribute{
+ name
+ }
+ attributeValue{
+ name
+ }
}
}
errors {
diff --git a/tests/api/test_variant.py b/tests/api/test_variant.py
index 0aeb083eb7..cb45a41f85 100644
--- a/tests/api/test_variant.py
+++ b/tests/api/test_variant.py
@@ -26,8 +26,12 @@ def test_create_variant(admin_api_client, product, product_type):
name
sku
attributes{
- name
- value
+ attribute{
+ slug
+ }
+ attributeValue{
+ slug
+ }
}
quantity
priceOverride {
@@ -71,8 +75,8 @@ def test_create_variant(admin_api_client, product, product_type):
assert data['costPrice']['amount'] == cost_price
assert data['priceOverride']['amount'] == price_override
assert data['sku'] == sku
- assert data['attributes'][0]['name'] == variant_slug
- assert data['attributes'][0]['value'] == variant_value
+ assert data['attributes'][0]['attribute']['slug'] == variant_slug
+ assert data['attributes'][0]['attributeValue']['slug'] == variant_value
def test_update_product_variant(admin_api_client, product):