Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Resort imports in saleor and tests
Unknown893843f85eb2
diff --git a/saleor/core/utils/__init__.py b/saleor/core/utils/__init__.pyindex ad24108850..933648eeea 100644--- a/saleor/core/utils/__init__.py+++ b/saleor/core/utils/__init__.py@@ -17,7 +17,6 @@ from django_countries import countriesfrom django_countries.fields import Countryfrom django_prices_openexchangerates import exchange_currencyfrom django_prices_openexchangerates.tasks import update_conversion_rates-from geolite2 import geolite2from prices import MoneyRangefrom versatileimagefield.image_warmer import VersatileImageFieldWarmerdiff --git a/saleor/graphql/core/types/__init__.py b/saleor/graphql/core/types/__init__.pyindex 5e3a29cdb0..bb58b8f867 100644--- a/saleor/graphql/core/types/__init__.py+++ b/saleor/graphql/core/types/__init__.py@@ -2,5 +2,5 @@ from .common import (CountryDisplay, Error, LanguageDisplay, PermissionDisplay, SeoInput,Weight)from .money import (- Money, MoneyRange, ReducedRate, TaxedMoney, TaxedMoneyRange, VAT)+ VAT, Money, MoneyRange, ReducedRate, TaxedMoney, TaxedMoneyRange)from .upload import Uploaddiff --git a/saleor/graphql/order/schema.py b/saleor/graphql/order/schema.pyindex bae2a6af7b..9c925dcabb 100644--- a/saleor/graphql/order/schema.py+++ b/saleor/graphql/order/schema.py@@ -10,7 +10,7 @@ from ..descriptions import DESCRIPTIONSfrom .enums import OrderStatusFilterfrom .mutations.draft_orders import (DraftOrderComplete, DraftOrderCreate, DraftOrderDelete,- DraftOrderLinesCreate, DraftOrderLineDelete, DraftOrderLineUpdate,+ DraftOrderLineDelete, DraftOrderLinesCreate, DraftOrderLineUpdate,DraftOrderUpdate)from .mutations.fulfillments import (FulfillmentCancel, FulfillmentCreate, FulfillmentUpdateTracking)diff --git a/saleor/payment/gateways/dummy/__init__.py b/saleor/payment/gateways/dummy/__init__.pyindex fe486c0520..f11ceb9557 100644--- a/saleor/payment/gateways/dummy/__init__.py+++ b/saleor/payment/gateways/dummy/__init__.py@@ -1,7 +1,6 @@import uuidfrom typing import Dict-from ... import ChargeStatusfrom .forms import DummyPaymentFormdiff --git a/saleor/wsgi/__init__.py b/saleor/wsgi/__init__.pyindex 6a652fef35..e1f0e86b4d 100644--- a/saleor/wsgi/__init__.py+++ b/saleor/wsgi/__init__.py@@ -12,17 +12,18 @@ middleware here, or combine a Django application with an application of anotherframework."""import os++from django.core.wsgi import get_wsgi_application++from saleor.wsgi.health_check import health_check+os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'saleor.settings')# This application object is used by any WSGI server configured to use this# file. This includes Django's development server, if the WSGI_APPLICATION# setting points here.-from django.core.wsgi import get_wsgi_application # noqaapplication = get_wsgi_application()-# Apply WSGI middleware here.# from helloworld.wsgi import HelloWorldApplication# application = HelloWorldApplication(application)-from saleor.wsgi.health_check import health_check # noqa-application = health_check(application, '/health/')diff --git a/tests/api/conftest.py b/tests/api/conftest.pyindex fbe4801ecb..e44130b788 100644--- a/tests/api/conftest.py+++ b/tests/api/conftest.py@@ -1,7 +1,8 @@import json-from django.core.serializers.json import DjangoJSONEncoder+import pytestfrom django.contrib.auth.models import AnonymousUser+from django.core.serializers.json import DjangoJSONEncoderfrom django.shortcuts import reversefrom django.test.client import MULTIPART_CONTENT, Clientfrom graphql_jwt.shortcuts import get_tokendiff --git a/tests/api/test_account.py b/tests/api/test_account.pyindex 14a0b65592..464797ef22 100644--- a/tests/api/test_account.py+++ b/tests/api/test_account.py@@ -7,12 +7,12 @@ import pytestfrom django.contrib.auth import get_user_modelfrom django.contrib.auth.tokens import default_token_generatorfrom django.shortcuts import reverse-from tests.api.utils import get_graphql_contentfrom saleor.account.models import Address, Userfrom saleor.graphql.account.mutations import (CustomerDelete, SetPassword, StaffDelete, StaffUpdate, UserDelete)from saleor.graphql.core.enums import PermissionEnum+from tests.api.utils import get_graphql_contentfrom .utils import assert_no_permission, convert_dict_keys_to_camel_casediff --git a/tests/api/test_attributes.py b/tests/api/test_attributes.pyindex 216ffb53cd..449417fa39 100644--- a/tests/api/test_attributes.py+++ b/tests/api/test_attributes.py@@ -2,12 +2,12 @@ import grapheneimport pytestfrom django.db.models import Qfrom django.template.defaultfilters import slugify-from tests.api.utils import get_graphql_contentfrom saleor.graphql.product.enums import AttributeTypeEnum, AttributeValueTypefrom saleor.graphql.product.types import resolve_attribute_value_typefrom saleor.graphql.product.utils import attributes_to_hstorefrom saleor.product.models import Attribute, AttributeValue, Category+from tests.api.utils import get_graphql_contentdef test_attributes_to_hstore(product, color_attribute):diff --git a/tests/api/test_base_mutation.py b/tests/api/test_base_mutation.pyindex e5d98b0902..9dd03e9554 100644--- a/tests/api/test_base_mutation.py+++ b/tests/api/test_base_mutation.py@@ -1,7 +1,8 @@+from unittest.mock import Mock+import grapheneimport pytestfrom django.core.exceptions import ImproperlyConfigured-from unittest.mock import Mockfrom saleor.graphql.core.mutations import BaseMutationfrom saleor.graphql.product import types as product_typesdiff --git a/tests/api/test_category.py b/tests/api/test_category.pyindex 8cb1209d25..0ea8680c25 100644--- a/tests/api/test_category.py+++ b/tests/api/test_category.py@@ -4,10 +4,10 @@ import grapheneimport pytestfrom django.template.defaultfilters import slugifyfrom graphql_relay import to_global_id-from tests.api.utils import get_graphql_content, get_multipart_request_body-from tests.utils import create_image, create_pdf_file_with_image_extfrom saleor.product.models import Category+from tests.api.utils import get_graphql_content, get_multipart_request_body+from tests.utils import create_image, create_pdf_file_with_image_extdef test_category_query(user_api_client, product):diff --git a/tests/api/test_checkout.py b/tests/api/test_checkout.pyindex df148a0459..fdf869e4c7 100644--- a/tests/api/test_checkout.py+++ b/tests/api/test_checkout.py@@ -3,12 +3,12 @@ from unittest.mock import ANY, patchimport grapheneimport pytest-from tests.api.utils import get_graphql_contentfrom saleor.checkout.models import Cartfrom saleor.checkout.utils import is_fully_paid, ready_to_place_orderfrom saleor.graphql.core.utils import str_to_enumfrom saleor.order.models import Order+from tests.api.utils import get_graphql_contentMUTATION_CHECKOUT_CREATE = """mutation createCheckout($checkoutInput: CheckoutCreateInput!) {diff --git a/tests/api/test_collection.py b/tests/api/test_collection.pyindex 0b8613d3c4..15c40283d7 100644--- a/tests/api/test_collection.py+++ b/tests/api/test_collection.py@@ -5,9 +5,9 @@ import grapheneimport pytestfrom django.utils.text import slugifyfrom graphql_relay import to_global_id-from tests.utils import create_image, create_pdf_file_with_image_extfrom saleor.product.models import Collection+from tests.utils import create_image, create_pdf_file_with_image_extfrom .utils import get_graphql_content, get_multipart_request_bodydiff --git a/tests/api/test_order.py b/tests/api/test_order.pyindex e29bce0fb9..6f5527e360 100644--- a/tests/api/test_order.py+++ b/tests/api/test_order.py@@ -5,6 +5,7 @@ import pytestfrom saleor.core.utils.taxes import ZERO_TAXED_MONEYfrom saleor.graphql.core.enums import ReportingPeriod+from saleor.graphql.order.enums import OrderEventsEmailsEnum, OrderStatusFilterfrom saleor.graphql.order.mutations.orders import (clean_order_cancel, clean_order_capture, clean_refund_payment,clean_void_payment)diff --git a/tests/api/test_shop.py b/tests/api/test_shop.pyindex c02ae0466c..cd0532a1cb 100644--- a/tests/api/test_shop.py+++ b/tests/api/test_shop.py@@ -3,12 +3,12 @@ from unittest.mock import patchimport graphenefrom django_countries import countriesfrom django_prices_vatlayer.models import VAT-from tests.api.utils import get_graphql_contentfrom saleor.core.permissions import MODELS_PERMISSIONSfrom saleor.graphql.core.utils import str_to_enumfrom saleor.site import AuthenticationBackendsfrom saleor.site.models import Site+from tests.api.utils import get_graphql_contentdef test_query_authorization_keys(diff --git a/tests/api/utils.py b/tests/api/utils.pyindex 9a83312581..0dae06e619 100644--- a/tests/api/utils.py+++ b/tests/api/utils.py@@ -1,4 +1,5 @@import json+from django.core.serializers.json import DjangoJSONEncoderfrom saleor.graphql.core.utils import snake_to_camel_casediff --git a/tests/conftest.py b/tests/conftest.pyindex 5ffe6922ec..6e566a7b39 100644--- a/tests/conftest.py+++ b/tests/conftest.py@@ -1,5 +1,6 @@from io import BytesIOfrom unittest.mock import MagicMock, Mock+import pytestfrom django.contrib.auth.models import Permissionfrom django.contrib.sites.models import Sitediff --git a/tests/test_collection.py b/tests/test_collection.pyindex 74a0bb1b0f..8e10271059 100644--- a/tests/test_collection.py+++ b/tests/test_collection.py@@ -1,5 +1,7 @@-from django.urls import reversefrom datetime import date, timedelta++from django.urls import reverse+from .utils import get_redirect_location