Skip to content

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

Refactor import in api checkout tests

fowczrek8dd9451f3f6f
diff --git a/saleor/graphql/checkout/tests/benchmark/conftest.py b/saleor/graphql/checkout/tests/benchmark/conftest.py
index fc29e0b8ba..4548b64ea2 100644
--- a/saleor/graphql/checkout/tests/benchmark/conftest.py
+++ b/saleor/graphql/checkout/tests/benchmark/conftest.py
@@ -1,9 +1,9 @@
import pytest
-from saleor.checkout import calculations
-from saleor.checkout.utils import add_variant_to_checkout
-from saleor.payment import ChargeStatus, TransactionKind
-from saleor.payment.models import Payment
+from .....checkout import calculations
+from .....checkout.utils import add_variant_to_checkout
+from .....payment import ChargeStatus, TransactionKind
+from .....payment.models import Payment
@pytest.fixture
diff --git a/saleor/graphql/checkout/tests/benchmark/test_checkout_mutations.py b/saleor/graphql/checkout/tests/benchmark/test_checkout_mutations.py
index a347c1b9ac..a8660cc1c4 100644
--- a/saleor/graphql/checkout/tests/benchmark/test_checkout_mutations.py
+++ b/saleor/graphql/checkout/tests/benchmark/test_checkout_mutations.py
@@ -1,9 +1,9 @@
import pytest
from graphene import Node
-from saleor.checkout import calculations
-from saleor.checkout.models import Checkout
-from saleor.graphql.tests.utils import get_graphql_content
+from .....checkout import calculations
+from .....checkout.models import Checkout
+from ....tests.utils import get_graphql_content
FRAGMENT_PRICE = """
fragment Price on TaxedMoney {
diff --git a/saleor/graphql/checkout/tests/benchmark/test_homepage.py b/saleor/graphql/checkout/tests/benchmark/test_homepage.py
index 9cdb31ee2e..9575750c11 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 saleor.graphql.tests.utils import get_graphql_content
+from ....tests.utils import get_graphql_content
@pytest.mark.django_db
diff --git a/saleor/graphql/checkout/tests/test_checkout.py b/saleor/graphql/checkout/tests/test_checkout.py
index eb0919a5fd..8f75c27c3d 100644
--- a/saleor/graphql/checkout/tests/test_checkout.py
+++ b/saleor/graphql/checkout/tests/test_checkout.py
@@ -8,28 +8,25 @@ import pytest
from django.core.exceptions import ValidationError
from prices import Money, TaxedMoney
-from saleor.account.models import User
-from saleor.checkout import calculations
-from saleor.checkout.error_codes import CheckoutErrorCode
-from saleor.checkout.models import Checkout
-from saleor.checkout.utils import is_fully_paid
-from saleor.core.payments import PaymentInterface
-from saleor.core.taxes import zero_money
-from saleor.graphql.checkout.mutations import (
+from ....account.models import User
+from ....checkout import calculations
+from ....checkout.error_codes import CheckoutErrorCode
+from ....checkout.models import Checkout
+from ....checkout.utils import is_fully_paid
+from ....core.payments import PaymentInterface
+from ....core.taxes import zero_money
+from ....order.models import Order
+from ....payment import TransactionKind
+from ....payment.interface import GatewayResponse
+from ....plugins.manager import PluginsManager
+from ....warehouse.models import Stock
+from ....warehouse.tests.utils import get_available_quantity_for_stock
+from ...checkout.mutations import (
clean_shipping_method,
update_checkout_shipping_method_if_invalid,
)
-from saleor.graphql.checkout.utils import (
- clean_checkout_payment,
- clean_checkout_shipping,
-)
-from saleor.graphql.tests.utils import assert_no_permission, get_graphql_content
-from saleor.order.models import Order
-from saleor.payment import TransactionKind
-from saleor.payment.interface import GatewayResponse
-from saleor.plugins.manager import PluginsManager
-from saleor.warehouse.models import Stock
-from saleor.warehouse.tests.utils import get_available_quantity_for_stock
+from ...checkout.utils import clean_checkout_payment, clean_checkout_shipping
+from ...tests.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.py
index dda58fb145..1957388fdb 100644
--- a/saleor/graphql/checkout/tests/test_checkout_digital.py
+++ b/saleor/graphql/checkout/tests/test_checkout_digital.py
@@ -2,15 +2,14 @@
import graphene
import pytest
-from saleor.account.models import Address
-from saleor.checkout import calculations
-from saleor.checkout.error_codes import CheckoutErrorCode
-from saleor.checkout.models import Checkout
-from saleor.checkout.utils import add_variant_to_checkout
-from saleor.graphql.checkout.mutations import update_checkout_shipping_method_if_invalid
-from saleor.graphql.tests.utils import get_graphql_content
-from saleor.order.models import Order
-
+from ....account.models import Address
+from ....checkout import calculations
+from ....checkout.error_codes import CheckoutErrorCode
+from ....checkout.models import Checkout
+from ....checkout.utils import add_variant_to_checkout
+from ....order.models import Order
+from ...checkout.mutations import update_checkout_shipping_method_if_invalid
+from ...tests.utils import get_graphql_content
from .test_checkout import (
MUTATION_CHECKOUT_COMPLETE,
MUTATION_CHECKOUT_CREATE,
diff --git a/saleor/graphql/checkout/tests/test_checkout_promo_codes.py b/saleor/graphql/checkout/tests/test_checkout_promo_codes.py
index 38a9f7b8d3..cd6c1665d3 100644
--- a/saleor/graphql/checkout/tests/test_checkout_promo_codes.py
+++ b/saleor/graphql/checkout/tests/test_checkout_promo_codes.py
@@ -4,11 +4,10 @@ from decimal import Decimal
import graphene
from prices import Money
-from saleor.checkout import calculations
-from saleor.checkout.utils import add_voucher_to_checkout
-from saleor.discount import DiscountInfo, VoucherType
-from saleor.graphql.tests.utils import get_graphql_content
-
+from ....checkout import calculations
+from ....checkout.utils import add_voucher_to_checkout
+from ....discount import DiscountInfo, VoucherType
+from ...tests.utils import get_graphql_content
from .test_checkout import (
MUTATION_CHECKOUT_LINES_DELETE,
MUTATION_CHECKOUT_SHIPPING_ADDRESS_UPDATE,