Skip to content

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

Add DUMMY_GATEWAY const in test_payment

IKarbowiak3fbd3b9ade3c
diff --git a/saleor/graphql/payment/tests/test_payment.py b/saleor/graphql/payment/tests/test_payment.py
index 71eea69712..0ac78af507 100644
--- a/saleor/graphql/payment/tests/test_payment.py
+++ b/saleor/graphql/payment/tests/test_payment.py
@@ -12,6 +12,8 @@ from ....payment.utils import fetch_customer_id, store_customer_id
from ...tests.utils import assert_no_permission, get_graphql_content
from ..enums import OrderAction, PaymentChargeStatusEnum
+DUMMY_GATEWAY = "mirumee.payments.dummy"
+
VOID_QUERY = """
mutation PaymentVoid($paymentId: ID!) {
paymentVoid(paymentId: $paymentId) {
@@ -102,7 +104,7 @@ def test_checkout_add_payment_without_shipping_method_and_not_shipping_required(
variables = {
"checkoutId": checkout_id,
"input": {
- "gateway": "mirumee.payments.dummy",
+ "gateway": DUMMY_GATEWAY,
"token": "sample-token",
"amount": total.gross.amount,
},
@@ -138,7 +140,7 @@ def test_checkout_add_payment_without_shipping_method_with_shipping_required(
variables = {
"checkoutId": checkout_id,
"input": {
- "gateway": "mirumee.payments.dummy",
+ "gateway": DUMMY_GATEWAY,
"token": "sample-token",
"amount": total.gross.amount,
},
@@ -165,7 +167,7 @@ def test_checkout_add_payment_with_shipping_method_and_shipping_required(
variables = {
"checkoutId": checkout_id,
"input": {
- "gateway": "mirumee.payments.dummy",
+ "gateway": DUMMY_GATEWAY,
"token": "sample-token",
"amount": total.gross.amount,
},
@@ -201,7 +203,7 @@ def test_checkout_add_payment(
variables = {
"checkoutId": checkout_id,
"input": {
- "gateway": "mirumee.payments.dummy",
+ "gateway": DUMMY_GATEWAY,
"token": "sample-token",
"amount": total.gross.amount,
},
@@ -237,7 +239,7 @@ def test_checkout_add_payment_default_amount(
variables = {
"checkoutId": checkout_id,
- "input": {"gateway": "mirumee.payments.dummy", "token": "sample-token"},
+ "input": {"gateway": DUMMY_GATEWAY, "token": "sample-token"},
}
response = user_api_client.post_graphql(CREATE_QUERY, variables)
content = get_graphql_content(response)
@@ -265,7 +267,7 @@ def test_checkout_add_payment_bad_amount(
variables = {
"checkoutId": checkout_id,
"input": {
- "gateway": "mirumee.payments.dummy",
+ "gateway": DUMMY_GATEWAY,
"token": "sample-token",
"amount": str(
calculations.checkout_total(
@@ -295,11 +297,7 @@ def test_checkout_add_payment_not_supported_gateways(
variables = {
"checkoutId": checkout_id,
- "input": {
- "gateway": "mirumee.payments.dummy",
- "token": "sample-token",
- "amount": "10.0",
- },
+ "input": {"gateway": DUMMY_GATEWAY, "token": "sample-token", "amount": "10.0"},
}
response = user_api_client.post_graphql(CREATE_QUERY, variables)
content = get_graphql_content(response)
@@ -319,7 +317,7 @@ def test_use_checkout_billing_address_as_payment_billing(
variables = {
"checkoutId": checkout_id,
"input": {
- "gateway": "mirumee.payments.dummy",
+ "gateway": DUMMY_GATEWAY,
"token": "sample-token",
"amount": total.gross.amount,
},
@@ -735,7 +733,7 @@ def set_braintree_customer_id(customer_user, braintree_customer_id):
@pytest.fixture
def set_dummy_customer_id(customer_user, dummy_customer_id):
- gateway_name = "mirumee.payments.dummy"
+ gateway_name = DUMMY_GATEWAY
store_customer_id(customer_user, gateway_name, dummy_customer_id)
return customer_user
@@ -743,7 +741,7 @@ def set_dummy_customer_id(customer_user, dummy_customer_id):
def test_list_payment_sources(
mocker, dummy_customer_id, set_dummy_customer_id, user_api_client
):
- gateway = "mirumee.payments.dummy"
+ gateway = DUMMY_GATEWAY
query = """
{
me {