Skip to content

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

Fix broken tests

Adam Janik5855470fd0ff
diff --git a/saleor/dashboard/graphql/mutations.py b/saleor/dashboard/graphql/mutations.py
index eb6463fcff..ae7ef4857b 100644
--- a/saleor/dashboard/graphql/mutations.py
+++ b/saleor/dashboard/graphql/mutations.py
@@ -14,7 +14,7 @@ from .utils import get_attributes_dict_from_list
registry = get_global_registry()
-def convert_form_fields(form_class, exclude):
+def convert_form_fields(form_class, exclude=None):
"""Convert form fields to Graphene fields"""
fields = OrderedDict()
if exclude is None:
diff --git a/tests/dashboard/test_graphql.py b/tests/dashboard/test_graphql.py
index d1226eef28..314acd57ed 100644
--- a/tests/dashboard/test_graphql.py
+++ b/tests/dashboard/test_graphql.py
@@ -38,7 +38,7 @@ def test_model_form_mutation(
# check if declarative arguments are present
assert 'test_input' in arguments
# check if model form field is present
- mocked_convert_form_fields.assert_called_with(model_form_class)
+ mocked_convert_form_fields.assert_called_with(model_form_class, None)
assert 'test_field' in arguments
output_fields = meta.fields
diff --git a/tests/test_graphql.py b/tests/test_graphql.py
index 56a4f1c2df..915e531139 100644
--- a/tests/test_graphql.py
+++ b/tests/test_graphql.py
@@ -114,10 +114,20 @@ def test_product_query(client, product_in_stock):
name
url
thumbnailUrl
- images { url }
+ images {
+ edges {
+ node {
+ url
+ }
+ }
+ }
variants {
- name
- stockQuantity
+ edges {
+ node {
+ name
+ stockQuantity
+ }
+ }
}
availability {
available,