Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Fix tests
Marcin Gębalaf939a7dfa5ad
diff --git a/saleor/graphql/translations/mutations.py b/saleor/graphql/translations/mutations.pyindex ae19c4e32f..2d3e31cccc 100644--- a/saleor/graphql/translations/mutations.py+++ b/saleor/graphql/translations/mutations.py@@ -1,4 +1,3 @@-from enum import Enumimport graphenefrom django.core.exceptions import ValidationError@@ -9,8 +8,8 @@ from ...page import models as page_modelsfrom ...product import models as product_modelsfrom ...shipping import models as shipping_modelsfrom ..core.mutations import BaseMutation, ModelMutation, registry-from ..shop.types import Shopfrom ..core.types.common import TranslationError+from ..shop.types import Shopfrom .enums import LanguageCodeEnum# discount types need to be imported to get Voucher in the graphene registrydiff --git a/tests/api/test_graphql.py b/tests/api/test_graphql.pyindex ff3005ea8c..28136f88f0 100644--- a/tests/api/test_graphql.py+++ b/tests/api/test_graphql.py@@ -6,6 +6,7 @@ import pytestfrom django.contrib.auth.models import AnonymousUserfrom django.db.models import Qfrom django.shortcuts import reverse+from graphql.error import GraphQLErrorfrom graphql_relay import to_global_idfrom saleor.graphql.product.types import Product@@ -247,10 +248,10 @@ def test_get_nodes(product_list):invalid_item = Mock(type="test", pk=123)invalid_item_global_id = to_global_id(invalid_item.type, invalid_item.pk)global_ids.append(invalid_item_global_id)- with pytest.raises(AssertionError) as exc:+ with pytest.raises(GraphQLError) as exc:get_nodes(global_ids, Product)- assert exc.value.args == ("Must receive an Product id.",)+ assert exc.value.args == (f"Must receive Product id: {invalid_item_global_id}",)# Raise an error if no nodes were foundglobal_ids = []