Skip to content

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

Apply code review suggestions

IKarbowiak328180ddcbab
diff --git a/saleor/graphql/checkout/tests/test_checkout.py b/saleor/graphql/checkout/tests/test_checkout.py
index fb1a92f45d..2d6c9875bc 100644
--- a/saleor/graphql/checkout/tests/test_checkout.py
+++ b/saleor/graphql/checkout/tests/test_checkout.py
@@ -559,8 +559,8 @@ def expected_dummy_gateway():
}
-GET_CHECKOUT_QUERY = """
-query getCheckout($token: UUID!) {
+GET_CHECKOUT_PAYMENTS_QUERY = """
+query getCheckoutPayments($token: UUID!) {
checkout(token: $token) {
availablePaymentGateways {
id
@@ -578,7 +578,7 @@ query getCheckout($token: UUID!) {
def test_checkout_available_payment_gateways(
api_client, checkout_with_item, expected_dummy_gateway
):
- query = GET_CHECKOUT_QUERY
+ query = GET_CHECKOUT_PAYMENTS_QUERY
expected_warning = (
"Default currency used for Dummy. "
"DEFAULT_CURRENCY setting is deprecated, "
@@ -597,12 +597,12 @@ def test_checkout_available_payment_gateways(
@pytest.mark.filterwarnings("ignore::UserWarning")
def test_checkout_available_payment_gateways_currency_specified_USD(
- api_client, checkout_with_item, expected_dummy_gateway, add_sample_gateway
+ api_client, checkout_with_item, expected_dummy_gateway, sample_gateway
):
checkout_with_item.currency = "USD"
checkout_with_item.save(update_fields=["currency"])
- query = GET_CHECKOUT_QUERY
+ query = GET_CHECKOUT_PAYMENTS_QUERY
variables = {"token": str(checkout_with_item.token)}
response = api_client.post_graphql(query, variables)
@@ -617,12 +617,12 @@ def test_checkout_available_payment_gateways_currency_specified_USD(
@pytest.mark.filterwarnings("ignore::UserWarning")
def test_checkout_available_payment_gateways_currency_specified_PLN(
- api_client, checkout_with_item, expected_dummy_gateway, add_sample_gateway
+ api_client, checkout_with_item, expected_dummy_gateway, sample_gateway
):
checkout_with_item.currency = "PLN"
checkout_with_item.save(update_fields=["currency"])
- query = GET_CHECKOUT_QUERY
+ query = GET_CHECKOUT_PAYMENTS_QUERY
variables = {"token": str(checkout_with_item.token)}
response = api_client.post_graphql(query, variables)
diff --git a/saleor/graphql/shop/tests/test_shop.py b/saleor/graphql/shop/tests/test_shop.py
index abdcad3a61..f05fc38d1f 100644
--- a/saleor/graphql/shop/tests/test_shop.py
+++ b/saleor/graphql/shop/tests/test_shop.py
@@ -695,7 +695,7 @@ AVAILABLE_PAYMENT_GATEWAYS_QUERY = """
@pytest.mark.filterwarnings("ignore::UserWarning")
-def test_query_available_payment_gateways(user_api_client, add_sample_gateway):
+def test_query_available_payment_gateways(user_api_client, sample_gateway):
query = AVAILABLE_PAYMENT_GATEWAYS_QUERY
response = user_api_client.post_graphql(query)
content = get_graphql_content(response)
@@ -709,7 +709,7 @@ def test_query_available_payment_gateways(user_api_client, add_sample_gateway):
@pytest.mark.filterwarnings("ignore::UserWarning")
def test_query_available_payment_gateways_specified_currency_USD(
- user_api_client, add_sample_gateway
+ user_api_client, sample_gateway
):
query = AVAILABLE_PAYMENT_GATEWAYS_QUERY
response = user_api_client.post_graphql(query, {"currency": "USD"})
@@ -724,7 +724,7 @@ def test_query_available_payment_gateways_specified_currency_USD(
@pytest.mark.filterwarnings("ignore::UserWarning")
def test_query_available_payment_gateways_specified_currency_PLN(
- user_api_client, add_sample_gateway
+ user_api_client, sample_gateway
):
query = AVAILABLE_PAYMENT_GATEWAYS_QUERY
response = user_api_client.post_graphql(query, {"currency": "PLN"})
diff --git a/saleor/tests/fixtures.py b/saleor/tests/fixtures.py
index 48a4af7db7..cd52566f68 100644
--- a/saleor/tests/fixtures.py
+++ b/saleor/tests/fixtures.py
@@ -184,7 +184,7 @@ def setup_dummy_gateway(settings):
@pytest.fixture
-def add_sample_gateway(settings):
+def sample_gateway(settings):
settings.PLUGINS += [
"saleor.plugins.tests.sample_plugins.ActiveDummyPaymentGateway"
]