Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Move and split api test utils
fowczrekf12f64f901da
diff --git a/saleor/graphql/account/tests/benchmark/test_account.py b/saleor/graphql/account/tests/benchmark/test_account.pyindex 204efbf4fa..7601dd1579 100644--- a/saleor/graphql/account/tests/benchmark/test_account.py+++ b/saleor/graphql/account/tests/benchmark/test_account.py@@ -6,7 +6,7 @@ from django.contrib.auth.models import Groupfrom django.core.files import Filefrom saleor.account.models import User-from tests.api.utils import get_graphql_content+from saleor.graphql.tests.utils import get_graphql_content@pytest.mark.django_dbdiff --git a/saleor/graphql/account/tests/benchmark/test_permission_group.py b/saleor/graphql/account/tests/benchmark/test_permission_group.pyindex b0fc72a05a..62bf7e063f 100644--- a/saleor/graphql/account/tests/benchmark/test_permission_group.py+++ b/saleor/graphql/account/tests/benchmark/test_permission_group.py@@ -3,7 +3,7 @@ import pytestfrom django.contrib.auth.models import Groupfrom saleor.core.permissions import AccountPermissions-from tests.api.utils import get_graphql_content+from saleor.graphql.tests.utils import get_graphql_content@pytest.mark.django_dbdiff --git a/saleor/graphql/account/tests/test_account.py b/saleor/graphql/account/tests/test_account.pyindex 4c803eb759..7a852fb11b 100644--- a/saleor/graphql/account/tests/test_account.py+++ b/saleor/graphql/account/tests/test_account.py@@ -29,15 +29,15 @@ from saleor.graphql.account.mutations.staff import (StaffUpdate,UserDelete,)+from saleor.graphql.account.tests.utils import convert_dict_keys_to_camel_casefrom saleor.graphql.core.utils import str_to_enum-from saleor.order.models import FulfillmentStatus, Order-from saleor.product.tests.utils import create_image-from tests.api.utils import (+from saleor.graphql.tests.utils import (assert_no_permission,- convert_dict_keys_to_camel_case,get_graphql_content,get_multipart_request_body,)+from saleor.order.models import FulfillmentStatus, Order+from saleor.product.tests.utils import create_image@pytest.fixturediff --git a/saleor/graphql/account/tests/test_account_depreceated_service_account.py b/saleor/graphql/account/tests/test_account_depreceated_service_account.pyindex 640416c203..e750a4e5a1 100644--- a/saleor/graphql/account/tests/test_account_depreceated_service_account.py+++ b/saleor/graphql/account/tests/test_account_depreceated_service_account.py@@ -6,7 +6,7 @@ from freezegun import freeze_timefrom saleor.account.error_codes import AccountErrorCodefrom saleor.app.models import App, AppTokenfrom saleor.graphql.core.enums import PermissionEnum-from tests.api.utils import assert_no_permission, get_graphql_content+from saleor.graphql.tests.utils import assert_no_permission, get_graphql_content@pytest.fixturediff --git a/saleor/graphql/account/tests/test_account_events.py b/saleor/graphql/account/tests/test_account_events.pyindex 9d5a68ca47..9fc031890d 100644--- a/saleor/graphql/account/tests/test_account_events.py+++ b/saleor/graphql/account/tests/test_account_events.py@@ -3,7 +3,7 @@ from django.db import modelsfrom saleor.account import events as account_eventsfrom saleor.account.models import User-from tests.api.utils import get_graphql_content+from saleor.graphql.tests.utils import get_graphql_contentQUERY_CUSTOMER_EVENTS = """query customerEvents($customerId: ID!) {diff --git a/saleor/graphql/account/tests/test_account_meta.py b/saleor/graphql/account/tests/test_account_meta.pyindex 86c360e7b2..1a528c16c3 100644--- a/saleor/graphql/account/tests/test_account_meta.py+++ b/saleor/graphql/account/tests/test_account_meta.py@@ -4,7 +4,7 @@ import jsonimport grapheneimport pytest-from tests.api.utils import assert_no_permission, get_graphql_content+from saleor.graphql.tests.utils import assert_no_permission, get_graphql_contentPRIVATE_META_NAMESPACE = ""PUBLIC_META_NAMESPACE = ""diff --git a/saleor/graphql/account/tests/test_account_permission_group.py b/saleor/graphql/account/tests/test_account_permission_group.pyindex 734506057a..6dc6b2b4ba 100644--- a/saleor/graphql/account/tests/test_account_permission_group.py+++ b/saleor/graphql/account/tests/test_account_permission_group.py@@ -5,7 +5,7 @@ from django.contrib.auth.models import Groupfrom saleor.account.error_codes import PermissionGroupErrorCodefrom saleor.account.models import Userfrom saleor.core.permissions import AccountPermissions, AppPermission, OrderPermissions-from tests.api.utils import assert_no_permission, get_graphql_content+from saleor.graphql.tests.utils import assert_no_permission, get_graphql_contentPERMISSION_GROUP_CREATE_MUTATION = """mutation PermissionGroupCreate(diff --git a/saleor/graphql/account/tests/test_bulk_delete.py b/saleor/graphql/account/tests/test_bulk_delete.pyindex 7c78a07af5..7406d181e3 100644--- a/saleor/graphql/account/tests/test_bulk_delete.py+++ b/saleor/graphql/account/tests/test_bulk_delete.py@@ -6,7 +6,7 @@ from django.contrib.auth.models import Groupfrom saleor.account.error_codes import AccountErrorCodefrom saleor.account.models import Userfrom saleor.core.permissions import AccountPermissions, OrderPermissions-from tests.api.utils import assert_no_permission, get_graphql_content+from saleor.graphql.tests.utils import assert_no_permission, get_graphql_content@patch(diff --git a/saleor/graphql/account/tests/test_pagination.py b/saleor/graphql/account/tests/test_pagination.pyindex 29a0ccfc4a..3a958f006d 100644--- a/saleor/graphql/account/tests/test_pagination.py+++ b/saleor/graphql/account/tests/test_pagination.py@@ -2,8 +2,8 @@ import pytestfrom django.contrib.auth import models as auth_modelsfrom saleor.account.models import User+from saleor.graphql.tests.utils import get_graphql_contentfrom saleor.order.models import Order-from tests.api.utils import get_graphql_content@pytest.fixture()diff --git a/saleor/graphql/account/tests/test_pagination_deprecated_service_account.py b/saleor/graphql/account/tests/test_pagination_deprecated_service_account.pyindex 651278946b..e9c2365bc7 100644--- a/saleor/graphql/account/tests/test_pagination_deprecated_service_account.py+++ b/saleor/graphql/account/tests/test_pagination_deprecated_service_account.py@@ -1,7 +1,7 @@import pytestfrom saleor.app.models import App-from tests.api.utils import get_graphql_content+from saleor.graphql.tests.utils import get_graphql_content@pytest.fixture()diff --git a/saleor/graphql/account/tests/utils.py b/saleor/graphql/account/tests/utils.pynew file mode 100644index 0000000000..83c418d448--- /dev/null+++ b/saleor/graphql/account/tests/utils.py@@ -0,0 +1,14 @@+from saleor.graphql.core.utils import snake_to_camel_case+++def convert_dict_keys_to_camel_case(d):+ """Changes dict fields from d[field_name] to d[fieldName].++ Useful when dealing with dict data such as address that need to be parsed+ into graphql input.+ """+ data = {}+ for k, v in d.items():+ new_key = snake_to_camel_case(k)+ data[new_key] = d[k]+ return datadiff --git a/saleor/graphql/app/tests/test_app_mutations.py b/saleor/graphql/app/tests/test_app_mutations.pyindex e9ecb20e87..a4489ebaac 100644--- a/saleor/graphql/app/tests/test_app_mutations.py+++ b/saleor/graphql/app/tests/test_app_mutations.py@@ -3,7 +3,7 @@ import graphenefrom saleor.app.error_codes import AppErrorCodefrom saleor.app.models import App, AppTokenfrom saleor.graphql.core.enums import PermissionEnum-from tests.api.utils import assert_no_permission, get_graphql_content+from saleor.graphql.tests.utils import assert_no_permission, get_graphql_contentAPP_CREATE_MUTATION = """mutation AppCreate(diff --git a/saleor/graphql/app/tests/test_app_queries.py b/saleor/graphql/app/tests/test_app_queries.pyindex 10a07f6835..5a0579d4c2 100644--- a/saleor/graphql/app/tests/test_app_queries.py+++ b/saleor/graphql/app/tests/test_app_queries.py@@ -3,8 +3,8 @@ import pytestfrom freezegun import freeze_timefrom saleor.app.models import App+from saleor.graphql.tests.utils import assert_no_permission, get_graphql_contentfrom saleor.webhook.models import Webhook-from tests.api.utils import assert_no_permission, get_graphql_contentQUERY_APPS_WITH_FILTER = """query ($filter: AppFilterInput ){diff --git a/saleor/graphql/app/tests/test_pagination.py b/saleor/graphql/app/tests/test_pagination.pyindex d173c65b62..51c2901ed2 100644--- a/saleor/graphql/app/tests/test_pagination.py+++ b/saleor/graphql/app/tests/test_pagination.py@@ -1,7 +1,7 @@import pytestfrom saleor.app.models import App-from tests.api.utils import get_graphql_content+from saleor.graphql.tests.utils import get_graphql_content@pytest.fixture()diff --git a/saleor/graphql/checkout/tests/benchmark/test_checkout_mutations.py b/saleor/graphql/checkout/tests/benchmark/test_checkout_mutations.pyindex 02f441ee8b..a347c1b9ac 100644--- a/saleor/graphql/checkout/tests/benchmark/test_checkout_mutations.py+++ b/saleor/graphql/checkout/tests/benchmark/test_checkout_mutations.py@@ -3,7 +3,7 @@ from graphene import Nodefrom saleor.checkout import calculationsfrom saleor.checkout.models import Checkout-from tests.api.utils import get_graphql_content+from saleor.graphql.tests.utils import get_graphql_contentFRAGMENT_PRICE = """fragment Price on TaxedMoney {diff --git a/saleor/graphql/checkout/tests/benchmark/test_homepage.py b/saleor/graphql/checkout/tests/benchmark/test_homepage.pyindex aa97cf84f8..9cdb31ee2e 100644--- a/saleor/graphql/checkout/tests/benchmark/test_homepage.py+++ b/saleor/graphql/checkout/tests/benchmark/test_homepage.py@@ -1,6 +1,6 @@import pytest-from tests.api.utils import get_graphql_content+from saleor.graphql.tests.utils import get_graphql_content@pytest.mark.django_dbdiff --git a/saleor/graphql/checkout/tests/test_checkout.py b/saleor/graphql/checkout/tests/test_checkout.pyindex 997d8e285d..eb0919a5fd 100644--- a/saleor/graphql/checkout/tests/test_checkout.py+++ b/saleor/graphql/checkout/tests/test_checkout.py@@ -23,13 +23,13 @@ from saleor.graphql.checkout.utils import (clean_checkout_payment,clean_checkout_shipping,)+from saleor.graphql.tests.utils import assert_no_permission, get_graphql_contentfrom saleor.order.models import Orderfrom saleor.payment import TransactionKindfrom saleor.payment.interface import GatewayResponsefrom saleor.plugins.manager import PluginsManagerfrom saleor.warehouse.models import Stockfrom saleor.warehouse.tests.utils import get_available_quantity_for_stock-from tests.api.utils import assert_no_permission, get_graphql_content@pytest.fixture(autouse=True)diff --git a/saleor/graphql/checkout/tests/test_checkout_digital.py b/saleor/graphql/checkout/tests/test_checkout_digital.pyindex e3a3bed60a..dda58fb145 100644--- a/saleor/graphql/checkout/tests/test_checkout_digital.py+++ b/saleor/graphql/checkout/tests/test_checkout_digital.py@@ -8,8 +8,8 @@ from saleor.checkout.error_codes import CheckoutErrorCodefrom saleor.checkout.models import Checkoutfrom saleor.checkout.utils import add_variant_to_checkoutfrom saleor.graphql.checkout.mutations import update_checkout_shipping_method_if_invalid+from saleor.graphql.tests.utils import get_graphql_contentfrom saleor.order.models import Order-from tests.api.utils import get_graphql_contentfrom .test_checkout import (MUTATION_CHECKOUT_COMPLETE,diff --git a/saleor/graphql/checkout/tests/test_checkout_promo_codes.py b/saleor/graphql/checkout/tests/test_checkout_promo_codes.pyindex b658486f02..38a9f7b8d3 100644--- a/saleor/graphql/checkout/tests/test_checkout_promo_codes.py+++ b/saleor/graphql/checkout/tests/test_checkout_promo_codes.py@@ -7,7 +7,7 @@ from prices import Moneyfrom saleor.checkout import calculationsfrom saleor.checkout.utils import add_voucher_to_checkoutfrom saleor.discount import DiscountInfo, VoucherType-from tests.api.utils import get_graphql_content+from saleor.graphql.tests.utils import get_graphql_contentfrom .test_checkout import (MUTATION_CHECKOUT_LINES_DELETE,diff --git a/saleor/graphql/core/tests/test_core.py b/saleor/graphql/core/tests/test_core.pyindex 9abd4bbc53..982c71be0d 100644--- a/saleor/graphql/core/tests/test_core.py+++ b/saleor/graphql/core/tests/test_core.py@@ -21,10 +21,13 @@ from saleor.graphql.core.utils import (validate_slug_and_generate_if_needed,)from saleor.graphql.product import types as product_types+from saleor.graphql.tests.utils import (+ _get_graphql_content_from_response,+ get_graphql_content,+)from saleor.graphql.utils import get_database_id, requestor_is_superuserfrom saleor.graphql.utils.filters import filter_range_field, reporting_period_to_datefrom saleor.product.models import Category, Product-from tests.api.utils import _get_graphql_content_from_response, get_graphql_contentdef test_clean_seo_fields():diff --git a/saleor/graphql/core/tests/test_federation.py b/saleor/graphql/core/tests/test_federation.pyindex 11795dcd66..4ae1a75bc4 100644--- a/saleor/graphql/core/tests/test_federation.py+++ b/saleor/graphql/core/tests/test_federation.py@@ -1,7 +1,7 @@import grapheneimport pytest-from tests.api.utils import get_graphql_content+from saleor.graphql.tests.utils import get_graphql_content@pytest.fixturediff --git a/saleor/graphql/core/tests/test_graphql.py b/saleor/graphql/core/tests/test_graphql.pyindex ea9e6a9c20..06c075b890 100644--- a/saleor/graphql/core/tests/test_graphql.py+++ b/saleor/graphql/core/tests/test_graphql.py@@ -10,9 +10,9 @@ from graphql.error import GraphQLErrorfrom graphql_relay import to_global_idfrom saleor.graphql.product.types import Product+from saleor.graphql.tests.utils import get_graphql_contentfrom saleor.graphql.utils import get_nodesfrom saleor.graphql.utils.filters import filter_by_query_param-from tests.api.utils import get_graphql_contentdef test_middleware_dont_generate_sql_requests(client, settings, assert_num_queries):diff --git a/saleor/graphql/core/tests/test_scalars.py b/saleor/graphql/core/tests/test_scalars.pyindex c1a1cdbcfa..b82ed2ea84 100644--- a/saleor/graphql/core/tests/test_scalars.py+++ b/saleor/graphql/core/tests/test_scalars.py@@ -1,4 +1,4 @@-from tests.api.utils import get_graphql_content+from saleor.graphql.tests.utils import get_graphql_contentQUERY_CHECKOUT = """query getCheckout($token: UUID!) {diff --git a/saleor/graphql/core/tests/test_view.py b/saleor/graphql/core/tests/test_view.pyindex 40f3e625a4..0a2551e605 100644--- a/saleor/graphql/core/tests/test_view.py+++ b/saleor/graphql/core/tests/test_view.py@@ -7,7 +7,10 @@ from django.test import override_settingsfrom saleor.demo.views import EXAMPLE_QUERYfrom saleor.graphql.product.types import Productfrom saleor.graphql.tests.fixtures import API_PATH-from tests.api.utils import _get_graphql_content_from_response, get_graphql_content+from saleor.graphql.tests.utils import (+ _get_graphql_content_from_response,+ get_graphql_content,+)def test_batch_queries(category, product, api_client):diff --git a/saleor/graphql/discount/tests/test_bulk_delete.py b/saleor/graphql/discount/tests/test_bulk_delete.pyindex a1295d924e..7d9b3d856c 100644--- a/saleor/graphql/discount/tests/test_bulk_delete.py+++ b/saleor/graphql/discount/tests/test_bulk_delete.py@@ -2,7 +2,7 @@ import grapheneimport pytestfrom saleor.discount.models import Sale, Voucher-from tests.api.utils import get_graphql_content+from saleor.graphql.tests.utils import get_graphql_content@pytest.fixturediff --git a/saleor/graphql/discount/tests/test_discount.py b/saleor/graphql/discount/tests/test_discount.pyindex 4aa11ce656..a8106aa4fe 100644--- a/saleor/graphql/discount/tests/test_discount.py+++ b/saleor/graphql/discount/tests/test_discount.py@@ -10,7 +10,7 @@ from saleor.discount import DiscountValueType, VoucherTypefrom saleor.discount.error_codes import DiscountErrorCodefrom saleor.discount.models import Sale, Voucherfrom saleor.graphql.discount.enums import DiscountValueTypeEnum, VoucherTypeEnum-from tests.api.utils import get_graphql_content+from saleor.graphql.tests.utils import get_graphql_content@pytest.fixturediff --git a/saleor/graphql/discount/tests/test_pagination.py b/saleor/graphql/discount/tests/test_pagination.pyindex 5909c19029..87d29ecaab 100644--- a/saleor/graphql/discount/tests/test_pagination.py+++ b/saleor/graphql/discount/tests/test_pagination.py@@ -6,7 +6,7 @@ from freezegun import freeze_timefrom saleor.discount import DiscountValueType, VoucherTypefrom saleor.discount.models import Sale, Voucher-from tests.api.utils import get_graphql_content+from saleor.graphql.tests.utils import get_graphql_content@pytest.fixturediff --git a/saleor/graphql/giftcard/tests/test_gift_card.py b/saleor/graphql/giftcard/tests/test_gift_card.pyindex 748e0308ed..08c5226ac4 100644--- a/saleor/graphql/giftcard/tests/test_gift_card.py+++ b/saleor/graphql/giftcard/tests/test_gift_card.py@@ -3,7 +3,7 @@ from datetime import dateimport graphenefrom saleor.giftcard.error_codes import GiftCardErrorCode-from tests.api.utils import assert_no_permission, get_graphql_content+from saleor.graphql.tests.utils import assert_no_permission, get_graphql_contentdef test_query_gift_card_with_permissions(diff --git a/saleor/graphql/menu/tests/benchmark.py/test_homepage.py b/saleor/graphql/menu/tests/benchmark.py/test_homepage.pyindex 936b0491fd..d0cd09eaf9 100644--- a/saleor/graphql/menu/tests/benchmark.py/test_homepage.py+++ b/saleor/graphql/menu/tests/benchmark.py/test_homepage.py@@ -1,6 +1,6 @@import pytest-from tests.api.utils import get_graphql_content+from saleor.graphql.tests.utils import get_graphql_content@pytest.mark.django_dbdiff --git a/saleor/graphql/menu/tests/test_bulk_delete.py b/saleor/graphql/menu/tests/test_bulk_delete.pyindex 16d73668f3..a45ec4b4c9 100644--- a/saleor/graphql/menu/tests/test_bulk_delete.py+++ b/saleor/graphql/menu/tests/test_bulk_delete.py@@ -1,8 +1,9 @@import grapheneimport pytest+from saleor.graphql.menu.tests.utils import menu_item_to_json+from saleor.graphql.tests.utils import get_graphql_contentfrom saleor.menu.models import Menu, MenuItem-from tests.api.utils import get_graphql_content, menu_item_to_json@pytest.fixturediff --git a/saleor/graphql/menu/tests/test_menu.py b/saleor/graphql/menu/tests/test_menu.pyindex c162a212ee..023999841f 100644--- a/saleor/graphql/menu/tests/test_menu.py+++ b/saleor/graphql/menu/tests/test_menu.py@@ -5,9 +5,10 @@ import pytestfrom django.core.exceptions import ValidationErrorfrom saleor.graphql.menu.mutations import NavigationType, _validate_menu_item_instance+from saleor.graphql.menu.tests.utils import menu_item_to_json+from saleor.graphql.tests.utils import assert_no_permission, get_graphql_contentfrom saleor.menu.models import Menu, MenuItemfrom saleor.product.models import Category-from tests.api.utils import assert_no_permission, get_graphql_content, menu_item_to_jsondef test_validate_menu_item_instance(category, page):diff --git a/saleor/graphql/menu/tests/test_pagination.py b/saleor/graphql/menu/tests/test_pagination.pyindex 3ad2b746fd..ff5d47f1b1 100644--- a/saleor/graphql/menu/tests/test_pagination.py+++ b/saleor/graphql/menu/tests/test_pagination.py@@ -1,7 +1,7 @@import pytest+from saleor.graphql.tests.utils import get_graphql_contentfrom saleor.menu.models import Menu, MenuItem-from tests.api.utils import get_graphql_content@pytest.fixturediff --git a/saleor/graphql/menu/tests/utils.py b/saleor/graphql/menu/tests/utils.pynew file mode 100644index 0000000000..020327091d--- /dev/null+++ b/saleor/graphql/menu/tests/utils.py@@ -0,0 +1,8 @@+from saleor.menu.utils import get_menu_item_as_dict+++def menu_item_to_json(menu_item):+ """Transforms a menu item to a JSON representation as used in the storefront."""+ item_json = get_menu_item_as_dict(menu_item)+ item_json["child_items"] = []+ return item_jsondiff --git a/saleor/graphql/meta/tests/test_meta_mutations.py b/saleor/graphql/meta/tests/test_meta_mutations.pyindex 5c7eef7266..ebaefbaba4 100644--- a/saleor/graphql/meta/tests/test_meta_mutations.py+++ b/saleor/graphql/meta/tests/test_meta_mutations.py@@ -5,7 +5,7 @@ import graphenefrom saleor.core.error_codes import MetadataErrorCodefrom saleor.core.models import ModelWithMetadata-from tests.api.utils import assert_no_permission, get_graphql_content+from saleor.graphql.tests.utils import assert_no_permission, get_graphql_contentPRIVATE_KEY = "private_key"PRIVATE_VALUE = "private_vale"diff --git a/saleor/graphql/meta/tests/test_meta_queries.py b/saleor/graphql/meta/tests/test_meta_queries.pyindex 51daff5d44..2986cac4f4 100644--- a/saleor/graphql/meta/tests/test_meta_queries.py+++ b/saleor/graphql/meta/tests/test_meta_queries.py@@ -1,6 +1,6 @@import graphene-from tests.api.utils import assert_no_permission, get_graphql_content+from saleor.graphql.tests.utils import assert_no_permission, get_graphql_contentPRIVATE_KEY = "private_key"PRIVATE_VALUE = "private_vale"diff --git a/saleor/graphql/order/tests/benchmark/test_order.py b/saleor/graphql/order/tests/benchmark/test_order.pyindex b19eb36b8f..f16f2aafcc 100644--- a/saleor/graphql/order/tests/benchmark/test_order.py+++ b/saleor/graphql/order/tests/benchmark/test_order.py@@ -4,7 +4,7 @@ from saleor.graphql.checkout.tests.benchmark.test_checkout_mutations import (FRAGMENT_ADDRESS,FRAGMENT_PRODUCT_VARIANT,)-from tests.api.utils import get_graphql_content+from saleor.graphql.tests.utils import get_graphql_contentFRAGMENT_ORDER_DETAILS = (FRAGMENT_ADDRESSdiff --git a/saleor/graphql/order/tests/test_bulk_delete.py b/saleor/graphql/order/tests/test_bulk_delete.pyindex 52e1f0ec83..f31bfdd758 100644--- a/saleor/graphql/order/tests/test_bulk_delete.py+++ b/saleor/graphql/order/tests/test_bulk_delete.py@@ -1,7 +1,7 @@import graphene+from saleor.graphql.tests.utils import get_graphql_contentfrom saleor.order import OrderStatus, models as order_models-from tests.api.utils import get_graphql_contentMUTATION_DELETE_ORDER_LINES = """mutation draftOrderLinesBulkDelete($ids: [ID]!) {diff --git a/saleor/graphql/order/tests/test_fulfillment.py b/saleor/graphql/order/tests/test_fulfillment.pyindex 1a0c884edb..c189c8ec5a 100644--- a/saleor/graphql/order/tests/test_fulfillment.py+++ b/saleor/graphql/order/tests/test_fulfillment.py@@ -6,12 +6,12 @@ from django.contrib.auth.models import AnonymousUserfrom saleor.core.exceptions import InsufficientStockfrom saleor.core.permissions import OrderPermissions+from saleor.graphql.tests.utils import assert_no_permission, get_graphql_contentfrom saleor.order import OrderStatusfrom saleor.order.error_codes import OrderErrorCodefrom saleor.order.events import OrderEventsfrom saleor.order.models import FulfillmentStatusfrom saleor.warehouse.models import Allocation, Stock-from tests.api.utils import assert_no_permission, get_graphql_contentORDER_FULFILL_QUERY = """mutation fulfillOrder(diff --git a/saleor/graphql/order/tests/test_homepage.py b/saleor/graphql/order/tests/test_homepage.pyindex a6541f3460..dfeac701dd 100644--- a/saleor/graphql/order/tests/test_homepage.py+++ b/saleor/graphql/order/tests/test_homepage.py@@ -1,4 +1,4 @@-from tests.api.utils import get_graphql_content+from saleor.graphql.tests.utils import get_graphql_contentdef test_homepage_events(order_events, staff_api_client, permission_manage_orders):diff --git a/saleor/graphql/order/tests/test_order.py b/saleor/graphql/order/tests/test_order.pyindex 3588293afd..864e6780e8 100644--- a/saleor/graphql/order/tests/test_order.py+++ b/saleor/graphql/order/tests/test_order.py@@ -21,6 +21,7 @@ from saleor.graphql.order.mutations.orders import ()from saleor.graphql.order.utils import validate_draft_orderfrom saleor.graphql.payment.types import PaymentChargeStatusEnum+from saleor.graphql.tests.utils import assert_no_permission, get_graphql_contentfrom saleor.order import OrderStatus, events as order_eventsfrom saleor.order.error_codes import OrderErrorCodefrom saleor.order.models import Order, OrderEvent@@ -30,7 +31,6 @@ from saleor.plugins.manager import PluginsManagerfrom saleor.shipping.models import ShippingMethodfrom saleor.warehouse.models import Allocation, Stockfrom saleor.warehouse.tests.utils import get_available_quantity_for_stock-from tests.api.utils import assert_no_permission, get_graphql_content@pytest.fixturediff --git a/saleor/graphql/order/tests/test_pagination.py b/saleor/graphql/order/tests/test_pagination.pyindex be45661831..1451d1dd47 100644--- a/saleor/graphql/order/tests/test_pagination.py+++ b/saleor/graphql/order/tests/test_pagination.py@@ -6,9 +6,9 @@ import pytestfrom freezegun import freeze_timefrom prices import Money, TaxedMoney+from saleor.graphql.tests.utils import get_graphql_contentfrom saleor.order.models import Order, OrderStatusfrom saleor.payment import ChargeStatus-from tests.api.utils import get_graphql_content@pytest.fixture()diff --git a/saleor/graphql/page/tests/test_bulk_delete.py b/saleor/graphql/page/tests/test_bulk_delete.pyindex 62afe90fd9..63c153d6c0 100644--- a/saleor/graphql/page/tests/test_bulk_delete.py+++ b/saleor/graphql/page/tests/test_bulk_delete.py@@ -1,7 +1,7 @@import graphene+from saleor.graphql.tests.utils import get_graphql_contentfrom saleor.page.models import Page-from tests.api.utils import get_graphql_contentdef test_delete_pages(staff_api_client, page_list, permission_manage_pages):diff --git a/saleor/graphql/page/tests/test_page.py b/saleor/graphql/page/tests/test_page.pyindex 87b72b7bd6..8d7117b070 100644--- a/saleor/graphql/page/tests/test_page.py+++ b/saleor/graphql/page/tests/test_page.py@@ -6,9 +6,9 @@ from django.utils import timezonefrom django.utils.text import slugifyfrom freezegun import freeze_time+from saleor.graphql.tests.utils import get_graphql_contentfrom saleor.page.error_codes import PageErrorCodefrom saleor.page.models import Page-from tests.api.utils import get_graphql_contentPAGE_QUERY = """query PageQuery($id: ID, $slug: String) {diff --git a/saleor/graphql/payment/tests/test_payment.py b/saleor/graphql/payment/tests/test_payment.pyindex 7f4c3e0b30..aaaaa5c5c8 100644--- a/saleor/graphql/payment/tests/test_payment.py+++ b/saleor/graphql/payment/tests/test_payment.py@@ -6,11 +6,11 @@ from django_countries.fields import Countryfrom saleor.checkout import calculationsfrom saleor.graphql.payment.enums import OrderAction, PaymentChargeStatusEnum+from saleor.graphql.tests.utils import assert_no_permission, get_graphql_contentfrom saleor.payment.error_codes import PaymentErrorCodefrom saleor.payment.interface import CreditCardInfo, CustomerSource, TokenConfigfrom saleor.payment.models import ChargeStatus, Payment, TransactionKindfrom saleor.payment.utils import fetch_customer_id, store_customer_id-from tests.api.utils import assert_no_permission, get_graphql_contentVOID_QUERY = """mutation PaymentVoid($paymentId: ID!) {diff --git a/saleor/graphql/plugins/tests/test_plugins.py b/saleor/graphql/plugins/tests/test_plugins.pyindex 5c0d2c571a..a3a5cd7c98 100644--- a/saleor/graphql/plugins/tests/test_plugins.py+++ b/saleor/graphql/plugins/tests/test_plugins.py@@ -2,13 +2,13 @@ import copyimport pytest+from saleor.graphql.tests.utils import assert_no_permission, get_graphql_contentfrom saleor.plugins.base_plugin import ConfigurationTypeFieldfrom saleor.plugins.error_codes import PluginErrorCodefrom saleor.plugins.manager import get_plugins_managerfrom saleor.plugins.models import PluginConfigurationfrom saleor.plugins.tests.sample_plugins import PluginSamplefrom saleor.plugins.tests.utils import get_config_value-from tests.api.utils import assert_no_permission, get_graphql_content@pytest.fixturediff --git a/saleor/graphql/product/tests/benchmark/test_category.py b/saleor/graphql/product/tests/benchmark/test_category.pyindex 5f4ea73195..d7e441fa69 100644--- a/saleor/graphql/product/tests/benchmark/test_category.py+++ b/saleor/graphql/product/tests/benchmark/test_category.py@@ -1,7 +1,7 @@import grapheneimport pytest-from tests.api.utils import get_graphql_content+from saleor.graphql.tests.utils import get_graphql_content@pytest.mark.django_dbdiff --git a/saleor/graphql/product/tests/benchmark/test_collection.py b/saleor/graphql/product/tests/benchmark/test_collection.pyindex 212a3fdab5..4fbe3e1b5a 100644--- a/saleor/graphql/product/tests/benchmark/test_collection.py+++ b/saleor/graphql/product/tests/benchmark/test_collection.py@@ -1,7 +1,7 @@import grapheneimport pytest-from tests.api.utils import get_graphql_content+from saleor.graphql.tests.utils import get_graphql_content@pytest.mark.django_dbdiff --git a/saleor/graphql/product/tests/benchmark/test_homepage.py b/saleor/graphql/product/tests/benchmark/test_homepage.pyindex 23fdf9c0bc..7302147c46 100644--- a/saleor/graphql/product/tests/benchmark/test_homepage.py+++ b/saleor/graphql/product/tests/benchmark/test_homepage.py@@ -1,6 +1,6 @@import pytest-from tests.api.utils import get_graphql_content+from saleor.graphql.tests.utils import get_graphql_content@pytest.mark.django_dbdiff --git a/saleor/graphql/product/tests/benchmark/test_product.py b/saleor/graphql/product/tests/benchmark/test_product.pyindex 13bd2d6d98..80e265d9b2 100644--- a/saleor/graphql/product/tests/benchmark/test_product.py+++ b/saleor/graphql/product/tests/benchmark/test_product.py@@ -1,7 +1,7 @@import pytestfrom graphene import Node-from tests.api.utils import get_graphql_content+from saleor.graphql.tests.utils import get_graphql_content@pytest.mark.django_dbdiff --git a/saleor/graphql/product/tests/benchmark/test_variant.py b/saleor/graphql/product/tests/benchmark/test_variant.pyindex 63cb6a72d3..028926a927 100644--- a/saleor/graphql/product/tests/benchmark/test_variant.py+++ b/saleor/graphql/product/tests/benchmark/test_variant.py@@ -3,9 +3,9 @@ from uuid import uuid4import grapheneimport pytest+from saleor.graphql.tests.utils import get_graphql_contentfrom saleor.product.models import ProductVariantfrom saleor.warehouse.models import Stock-from tests.api.utils import get_graphql_content@pytest.mark.django_dbdiff --git a/saleor/graphql/product/tests/benchmark/test_variant_stocks.py b/saleor/graphql/product/tests/benchmark/test_variant_stocks.pyindex 78ea13524a..4ceb85cd67 100644--- a/saleor/graphql/product/tests/benchmark/test_variant_stocks.py+++ b/saleor/graphql/product/tests/benchmark/test_variant_stocks.py@@ -1,8 +1,8 @@import grapheneimport pytest+from saleor.graphql.tests.utils import get_graphql_contentfrom saleor.warehouse.models import Stock, Warehouse-from tests.api.utils import get_graphql_content@pytest.mark.django_dbdiff --git a/saleor/graphql/product/tests/test_attribute_pagination.py b/saleor/graphql/product/tests/test_attribute_pagination.pyindex c8666ac8a6..4a86cc85ce 100644--- a/saleor/graphql/product/tests/test_attribute_pagination.py+++ b/saleor/graphql/product/tests/test_attribute_pagination.py@@ -2,6 +2,7 @@ import grapheneimport pytestfrom prices import Money+from saleor.graphql.tests.utils import get_graphql_contentfrom saleor.product.models import (Attribute,AttributeProduct,@@ -9,7 +10,6 @@ from saleor.product.models import (Product,ProductType,)-from tests.api.utils import get_graphql_content@pytest.fixturediff --git a/saleor/graphql/product/tests/test_attributes.py b/saleor/graphql/product/tests/test_attributes.pyindex f9c7616798..fbaf8b6313 100644--- a/saleor/graphql/product/tests/test_attributes.py+++ b/saleor/graphql/product/tests/test_attributes.py@@ -14,6 +14,7 @@ from saleor.graphql.product.enums import AttributeTypeEnum, AttributeValueTypefrom saleor.graphql.product.filters import filter_attributes_by_product_typesfrom saleor.graphql.product.mutations.attributes import validate_value_is_uniquefrom saleor.graphql.product.types.attributes import resolve_attribute_value_type+from saleor.graphql.tests.utils import get_graphql_contentfrom saleor.product import AttributeInputTypefrom saleor.product.error_codes import ProductErrorCodefrom saleor.product.models import (@@ -28,7 +29,6 @@ from saleor.product.models import (ProductVariant,)from saleor.product.utils.attributes import associate_attribute_values_to_instance-from tests.api.utils import get_graphql_contentdef test_validate_value_is_unique(color_attribute):diff --git a/saleor/graphql/product/tests/test_bulk_delete.py b/saleor/graphql/product/tests/test_bulk_delete.pyindex 59750a8fcb..84ee9d0913 100644--- a/saleor/graphql/product/tests/test_bulk_delete.py+++ b/saleor/graphql/product/tests/test_bulk_delete.py@@ -3,6 +3,7 @@ from unittest.mock import patchimport grapheneimport pytest+from saleor.graphql.tests.utils import get_graphql_contentfrom saleor.product.models import (Attribute,AttributeValue,@@ -13,7 +14,6 @@ from saleor.product.models import (ProductType,ProductVariant,)-from tests.api.utils import get_graphql_content@pytest.fixturediff --git a/saleor/graphql/product/tests/test_category.py b/saleor/graphql/product/tests/test_category.pyindex a61133dc64..41fd66ccf5 100644--- a/saleor/graphql/product/tests/test_category.py+++ b/saleor/graphql/product/tests/test_category.py@@ -6,10 +6,10 @@ import pytestfrom django.template.defaultfilters import slugifyfrom graphql_relay import to_global_id+from saleor.graphql.tests.utils import get_graphql_content, get_multipart_request_bodyfrom saleor.product.error_codes import ProductErrorCodefrom saleor.product.models import Categoryfrom saleor.product.tests.utils import create_image, create_pdf_file_with_image_ext-from tests.api.utils import get_graphql_content, get_multipart_request_bodyQUERY_CATEGORY = """query ($id: ID, $slug: String){diff --git a/saleor/graphql/product/tests/test_collection.py b/saleor/graphql/product/tests/test_collection.pyindex 8c5d236f38..f91a05d5c4 100644--- a/saleor/graphql/product/tests/test_collection.py+++ b/saleor/graphql/product/tests/test_collection.py@@ -6,10 +6,10 @@ import grapheneimport pytestfrom graphql_relay import to_global_id+from saleor.graphql.tests.utils import get_graphql_content, get_multipart_request_bodyfrom saleor.product.error_codes import ProductErrorCodefrom saleor.product.models import Collectionfrom saleor.product.tests.utils import create_image, create_pdf_file_with_image_ext-from tests.api.utils import get_graphql_content, get_multipart_request_bodyQUERY_COLLECTION = """query ($id: ID, $slug: String){diff --git a/saleor/graphql/product/tests/test_digital_content.py b/saleor/graphql/product/tests/test_digital_content.pyindex 8aab20e0a9..96eca1911f 100644--- a/saleor/graphql/product/tests/test_digital_content.py+++ b/saleor/graphql/product/tests/test_digital_content.py@@ -1,9 +1,9 @@import graphene+from saleor.graphql.tests.utils import get_graphql_content, get_multipart_request_bodyfrom saleor.product.error_codes import ProductErrorCodefrom saleor.product.models import DigitalContent, ProductVariantfrom saleor.product.tests.utils import create_image-from tests.api.utils import get_graphql_content, get_multipart_request_bodydef test_fetch_all_digital_contents(diff --git a/saleor/graphql/product/tests/test_product.py b/saleor/graphql/product/tests/test_product.pyindex 55954eb2c6..7385cc9ed9 100644--- a/saleor/graphql/product/tests/test_product.py+++ b/saleor/graphql/product/tests/test_product.py@@ -15,6 +15,11 @@ from saleor.core.taxes import TaxTypefrom saleor.graphql.core.enums import ReportingPeriodfrom saleor.graphql.product.bulk_mutations.products import ProductVariantStocksUpdatefrom saleor.graphql.product.utils import create_stocks+from saleor.graphql.tests.utils import (+ assert_no_permission,+ get_graphql_content,+ get_multipart_request_body,+)from saleor.plugins.manager import PluginsManagerfrom saleor.product import AttributeInputTypefrom saleor.product.error_codes import ProductErrorCode@@ -32,11 +37,6 @@ from saleor.product.tasks import update_variants_namesfrom saleor.product.tests.utils import create_image, create_pdf_file_with_image_extfrom saleor.product.utils.attributes import associate_attribute_values_to_instancefrom saleor.warehouse.models import Allocation, Stock, Warehouse-from tests.api.utils import (- assert_no_permission,- get_graphql_content,- get_multipart_request_body,-)@pytest.fixturediff --git a/saleor/graphql/product/tests/test_product_minimal_variant_price.py b/saleor/graphql/product/tests/test_product_minimal_variant_price.pyindex ee58a4acbb..ccb903d985 100644--- a/saleor/graphql/product/tests/test_product_minimal_variant_price.py+++ b/saleor/graphql/product/tests/test_product_minimal_variant_price.py@@ -6,8 +6,8 @@ from graphql_relay import from_global_id, to_global_idfrom prices import Moneyfrom saleor.graphql.discount.enums import DiscountValueTypeEnum+from saleor.graphql.tests.utils import get_graphql_contentfrom saleor.product.error_codes import ProductErrorCode-from tests.api.utils import get_graphql_contentdef test_product_create_sets_minimal_variant_price(diff --git a/saleor/graphql/product/tests/test_product_pagination.py b/saleor/graphql/product/tests/test_product_pagination.pyindex 1ae592aced..580ab096af 100644--- a/saleor/graphql/product/tests/test_product_pagination.py+++ b/saleor/graphql/product/tests/test_product_pagination.py@@ -4,6 +4,7 @@ import grapheneimport pytestfrom prices import Money+from saleor.graphql.tests.utils import get_graphql_contentfrom saleor.product.models import (Category,Collection,@@ -13,7 +14,6 @@ from saleor.product.models import ()from saleor.product.utils.attributes import associate_attribute_values_to_instancefrom saleor.warehouse.models import Stock-from tests.api.utils import get_graphql_content@pytest.fixturediff --git a/saleor/graphql/product/tests/test_product_sorting.py b/saleor/graphql/product/tests/test_product_sorting.pyindex 8b13b9f0d2..b4367500bf 100644--- a/saleor/graphql/product/tests/test_product_sorting.py+++ b/saleor/graphql/product/tests/test_product_sorting.py@@ -1,6 +1,6 @@import graphene-from tests.api.utils import get_graphql_content+from saleor.graphql.tests.utils import get_graphql_contentGET_SORTED_PRODUCTS_COLLECTION_QUERY = """query CollectionProducts($id: ID!) {diff --git a/saleor/graphql/product/tests/test_product_sorting_attributes.py b/saleor/graphql/product/tests/test_product_sorting_attributes.pyindex 946c7f9d72..c2d7c0803a 100644--- a/saleor/graphql/product/tests/test_product_sorting_attributes.py+++ b/saleor/graphql/product/tests/test_product_sorting_attributes.py@@ -4,9 +4,9 @@ import grapheneimport pytestfrom saleor.core.taxes import zero_money+from saleor.graphql.tests.utils import get_graphql_contentfrom saleor.product import models as product_modelsfrom saleor.product.utils.attributes import associate_attribute_values_to_instance-from tests.api.utils import get_graphql_contentHERE = os.path.realpath(os.path.dirname(__file__))diff --git a/saleor/graphql/product/tests/test_variant.py b/saleor/graphql/product/tests/test_variant.pyindex 62ffc6d1ac..d971044f2d 100644--- a/saleor/graphql/product/tests/test_variant.py+++ b/saleor/graphql/product/tests/test_variant.py@@ -5,12 +5,12 @@ import grapheneimport pytestfrom graphene.utils.str_converters import to_camel_case+from saleor.graphql.tests.utils import get_graphql_contentfrom saleor.product.error_codes import ProductErrorCodefrom saleor.product.models import ProductVariantfrom saleor.product.utils.attributes import associate_attribute_values_to_instancefrom saleor.warehouse.error_codes import StockErrorCodefrom saleor.warehouse.models import Stock, Warehouse-from tests.api.utils import get_graphql_contentdef test_fetch_variant(staff_api_client, product, permission_manage_products):diff --git a/saleor/graphql/product/tests/test_variant_pricing.py b/saleor/graphql/product/tests/test_variant_pricing.pyindex 02209597cd..188d093b2b 100644--- a/saleor/graphql/product/tests/test_variant_pricing.py+++ b/saleor/graphql/product/tests/test_variant_pricing.py@@ -2,10 +2,10 @@ from unittest.mock import Mockfrom prices import Money, TaxedMoney+from saleor.graphql.tests.utils import get_graphql_contentfrom saleor.plugins.manager import PluginsManagerfrom saleor.product.models import ProductVariantfrom saleor.product.utils.availability import get_variant_availability-from tests.api.utils import get_graphql_contentQUERY_GET_VARIANT_PRICING = """query {diff --git a/saleor/graphql/shipping/tests/test_bulk_delete.py b/saleor/graphql/shipping/tests/test_bulk_delete.pyindex ada17df549..dc9548ce3d 100644--- a/saleor/graphql/shipping/tests/test_bulk_delete.py+++ b/saleor/graphql/shipping/tests/test_bulk_delete.py@@ -1,8 +1,8 @@import grapheneimport pytest+from saleor.graphql.tests.utils import get_graphql_contentfrom saleor.shipping.models import ShippingMethod, ShippingZone-from tests.api.utils import get_graphql_content@pytest.fixturediff --git a/saleor/graphql/shipping/tests/test_shipping_method.py b/saleor/graphql/shipping/tests/test_shipping_method.pyindex ee78fc87b8..6aef1a118d 100644--- a/saleor/graphql/shipping/tests/test_shipping_method.py+++ b/saleor/graphql/shipping/tests/test_shipping_method.py@@ -2,8 +2,8 @@ import grapheneimport pytestfrom saleor.graphql.shipping.types import ShippingMethodTypeEnum+from saleor.graphql.tests.utils import get_graphql_contentfrom saleor.shipping.error_codes import ShippingErrorCode-from tests.api.utils import get_graphql_contentdef test_shipping_zone_query(diff --git a/saleor/graphql/shop/tests/benchmark/test_homepage.py b/saleor/graphql/shop/tests/benchmark/test_homepage.pyindex b21a5eeaee..0c76d3e55a 100644--- a/saleor/graphql/shop/tests/benchmark/test_homepage.py+++ b/saleor/graphql/shop/tests/benchmark/test_homepage.py@@ -1,6 +1,6 @@import pytest-from tests.api.utils import get_graphql_content+from saleor.graphql.tests.utils import get_graphql_content@pytest.mark.django_dbdiff --git a/saleor/graphql/shop/tests/test_shop.py b/saleor/graphql/shop/tests/test_shop.pyindex 0ad08fea29..3e83478685 100644--- a/saleor/graphql/shop/tests/test_shop.py+++ b/saleor/graphql/shop/tests/test_shop.py@@ -8,9 +8,9 @@ from saleor.account.models import Addressfrom saleor.core.error_codes import ShopErrorCodefrom saleor.core.permissions import get_permissions_codenamefrom saleor.graphql.core.utils import str_to_enum+from saleor.graphql.tests.utils import get_graphql_contentfrom saleor.site import AuthenticationBackendsfrom saleor.site.models import Site-from tests.api.utils import get_graphql_contentdef test_query_authorization_keys(diff --git a/saleor/graphql/shop/tests/test_shop_taxes.py b/saleor/graphql/shop/tests/test_shop_taxes.pyindex 34e89f9d9e..2905e925eb 100644--- a/saleor/graphql/shop/tests/test_shop_taxes.py+++ b/saleor/graphql/shop/tests/test_shop_taxes.py@@ -5,7 +5,7 @@ from django_prices_vatlayer.models import VATfrom django_prices_vatlayer.utils import get_tax_for_ratefrom saleor.graphql.core.utils import str_to_enum-from tests.api.utils import get_graphql_content+from saleor.graphql.tests.utils import get_graphql_content# FIXME we are going to rewrite tax section. Currently, below tests are connected only# with vatlayer. After we introduce approach for taxes and API, we should rebuild thisdiff --git a/saleor/graphql/tests/fixtures.py b/saleor/graphql/tests/fixtures.pyindex 39409cf634..00811ca0a5 100644--- a/saleor/graphql/tests/fixtures.py+++ b/saleor/graphql/tests/fixtures.py@@ -11,9 +11,9 @@ from graphql_jwt.shortcuts import get_tokenfrom saleor.account.models import Userfrom saleor.app.models import App+from saleor.graphql.tests.utils import assert_no_permissionfrom saleor.graphql.views import handled_errors_logger, unhandled_errors_loggerfrom saleor.tests.utils import flush_post_commit_hooks-from tests.api.utils import assert_no_permissionAPI_PATH = reverse("api")diff --git a/tests/api/utils.py b/saleor/graphql/tests/utils.pysimilarity index 66%rename from tests/api/utils.pyrename to saleor/graphql/tests/utils.pyindex 129dbe32e8..7bc4aabaac 100644--- a/tests/api/utils.py+++ b/saleor/graphql/tests/utils.py@@ -2,9 +2,6 @@ import jsonfrom django.core.serializers.json import DjangoJSONEncoder-from saleor.graphql.core.utils import snake_to_camel_case-from saleor.menu.utils import get_menu_item_as_dict-def _get_graphql_content_from_response(response):return json.loads(response.content.decode("utf8"))@@ -42,23 +39,3 @@ def get_multipart_request_body(query, variables, file, file_name):"map": json.dumps({file_name: ["variables.file"]}, cls=DjangoJSONEncoder),file_name: file,}---def convert_dict_keys_to_camel_case(d):- """Changes dict fields from d[field_name] to d[fieldName].-- Useful when dealing with dict data such as address that need to be parsed- into graphql input.- """- data = {}- for k, v in d.items():- new_key = snake_to_camel_case(k)- data[new_key] = d[k]- return data---def menu_item_to_json(menu_item):- """Transforms a menu item to a JSON representation as used in the storefront."""- item_json = get_menu_item_as_dict(menu_item)- item_json["child_items"] = []- return item_jsondiff --git a/saleor/graphql/translations/tests/test_translations.py b/saleor/graphql/translations/tests/test_translations.pyindex 07d5e90ffd..7dbed94fc4 100644--- a/saleor/graphql/translations/tests/test_translations.py+++ b/saleor/graphql/translations/tests/test_translations.py@@ -2,9 +2,9 @@ import grapheneimport pytestfrom django.contrib.auth.models import Permission+from saleor.graphql.tests.utils import assert_no_permission, get_graphql_contentfrom saleor.graphql.translations.schema import TranslatableKindsfrom saleor.graphql.translations.types import LanguageCodeEnum-from tests.api.utils import assert_no_permission, get_graphql_contentdef test_product_translation(user_api_client, product):diff --git a/saleor/graphql/warehouse/tests/test_pagination.py b/saleor/graphql/warehouse/tests/test_pagination.pyindex 19ec9f1a74..b5fa2da09c 100644--- a/saleor/graphql/warehouse/tests/test_pagination.py+++ b/saleor/graphql/warehouse/tests/test_pagination.py@@ -1,8 +1,8 @@import grapheneimport pytest+from saleor.graphql.tests.utils import get_graphql_contentfrom saleor.warehouse.models import Warehouse-from tests.api.utils import get_graphql_content@pytest.fixturediff --git a/saleor/graphql/warehouse/tests/test_stock.py b/saleor/graphql/warehouse/tests/test_stock.pyindex d2d693402f..986096fb75 100644--- a/saleor/graphql/warehouse/tests/test_stock.py+++ b/saleor/graphql/warehouse/tests/test_stock.py@@ -1,9 +1,9 @@import graphenefrom saleor.core.permissions import ProductPermissions+from saleor.graphql.tests.utils import assert_no_permission, get_graphql_contentfrom saleor.warehouse.models import Stockfrom saleor.warehouse.tests.utils import get_quantity_allocated_for_stock-from tests.api.utils import assert_no_permission, get_graphql_contentQUERY_STOCK = """query stock($id: ID!) {diff --git a/saleor/graphql/warehouse/tests/test_warehouse.py b/saleor/graphql/warehouse/tests/test_warehouse.pyindex df933eb3f8..9be586f3ff 100644--- a/saleor/graphql/warehouse/tests/test_warehouse.py+++ b/saleor/graphql/warehouse/tests/test_warehouse.py@@ -2,9 +2,9 @@ import grapheneimport pytestfrom saleor.account.models import Address+from saleor.graphql.tests.utils import get_graphql_contentfrom saleor.warehouse.error_codes import WarehouseErrorCodefrom saleor.warehouse.models import Warehouse-from tests.api.utils import get_graphql_contentQUERY_WAREHOUSES = """query {diff --git a/saleor/graphql/webhook/tests/test_pagination.py b/saleor/graphql/webhook/tests/test_pagination.pyindex 976be738ae..0cf356ce1b 100644--- a/saleor/graphql/webhook/tests/test_pagination.py+++ b/saleor/graphql/webhook/tests/test_pagination.py@@ -1,8 +1,8 @@import pytestfrom saleor.app.models import App+from saleor.graphql.tests.utils import get_graphql_contentfrom saleor.webhook.models import Webhook-from tests.api.utils import get_graphql_content@pytest.fixturediff --git a/saleor/graphql/webhook/tests/test_webhook.py b/saleor/graphql/webhook/tests/test_webhook.pyindex cf562d3d6f..c9e1d283d5 100644--- a/saleor/graphql/webhook/tests/test_webhook.py+++ b/saleor/graphql/webhook/tests/test_webhook.py@@ -4,13 +4,13 @@ import grapheneimport pytestfrom saleor.app.models import App+from saleor.graphql.tests.utils import assert_no_permission, get_graphql_contentfrom saleor.graphql.webhook.enums import (WebhookEventTypeEnum,WebhookSampleEventTypeEnum,)from saleor.webhook.event_types import WebhookEventTypefrom saleor.webhook.models import Webhook-from tests.api.utils import assert_no_permission, get_graphql_contentWEBHOOK_CREATE_BY_APP = """mutation webhookCreate($name: String, $target_url: String,diff --git a/saleor/graphql/webhook/tests/test_webhook_deprecated_service_account.py b/saleor/graphql/webhook/tests/test_webhook_deprecated_service_account.pyindex 7758a85224..6798aab9c4 100644--- a/saleor/graphql/webhook/tests/test_webhook_deprecated_service_account.py+++ b/saleor/graphql/webhook/tests/test_webhook_deprecated_service_account.py@@ -2,9 +2,9 @@ import grapheneimport pytestfrom saleor.app.models import App+from saleor.graphql.tests.utils import assert_no_permission, get_graphql_contentfrom saleor.graphql.webhook.enums import WebhookEventTypeEnumfrom saleor.webhook.models import Webhook-from tests.api.utils import assert_no_permission, get_graphql_contentfrom .test_webhook import QUERY_WEBHOOKS_WITH_SORTdiff --git a/saleor/graphql/wishlist/tests/test_wishlist.py b/saleor/graphql/wishlist/tests/test_wishlist.pyindex 4be52aefa4..13254fc55e 100644--- a/saleor/graphql/wishlist/tests/test_wishlist.py+++ b/saleor/graphql/wishlist/tests/test_wishlist.py@@ -1,8 +1,8 @@import grapheneimport pytest+from saleor.graphql.tests.utils import assert_no_permission, get_graphql_contentfrom saleor.wishlist.models import Wishlist-from tests.api.utils import assert_no_permission, get_graphql_content@pytest.mark.skip(reason="Wishlist temporary removed from api")