Skip to content

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

Align tests

Jakub Draganekf350082f1fcc
diff --git a/saleor/order/forms.py b/saleor/order/forms.py
index 20f1e5d835..eebafaa593 100644
--- a/saleor/order/forms.py
+++ b/saleor/order/forms.py
@@ -10,7 +10,10 @@ from .models import Order
def get_gateways():
- gateways = [(gtw, gtw.capitalize() + " gateway") for gtw in gateway.list_gateways()]
+ gateways = [
+ (gtw["name"], gtw["name"].capitalize() + " gateway")
+ for gtw in gateway.list_gateways()
+ ]
return gateways
diff --git a/tests/api/benchmark/test_checkout.py b/tests/api/benchmark/test_checkout.py
index dd559490f8..ef0b6e5c8a 100644
--- a/tests/api/benchmark/test_checkout.py
+++ b/tests/api/benchmark/test_checkout.py
@@ -134,7 +134,6 @@ def test_create_checkout(api_client, graphql_address_data, variant, count_querie
}
fragment Checkout on Checkout {
- availablePaymentGateways
token
id
user {
@@ -275,7 +274,6 @@ def test_add_shipping_to_checkout(
}
fragment Checkout on Checkout {
- availablePaymentGateways
token
id
user {
@@ -409,7 +407,6 @@ def test_add_billing_address_to_checkout(
}
fragment Checkout on Checkout {
- availablePaymentGateways
token
id
user {
diff --git a/tests/extensions/test_manager.py b/tests/extensions/test_manager.py
index ab84cbe782..5ce84681fb 100644
--- a/tests/extensions/test_manager.py
+++ b/tests/extensions/test_manager.py
@@ -373,6 +373,7 @@ def test_plugin_add_new_configuration(
class ActivePaymentGateway(BasePlugin):
+ CLIENT_CONFIG = [{"field": "foo", "value": "bar"}]
PLUGIN_NAME = "braintree"
@classmethod
@@ -388,6 +389,9 @@ class ActivePaymentGateway(BasePlugin):
def process_payment(self, payment_information, previous_value):
pass
+ def get_payment_config(self, previous_value):
+ return self.CLIENT_CONFIG
+
class InactivePaymentGateway(BasePlugin):
PLUGIN_NAME = "stripe"
@@ -407,10 +411,14 @@ class InactivePaymentGateway(BasePlugin):
def test_manager_serve_list_of_payment_gateways():
+ expected_gateway = {
+ "name": ActivePaymentGateway.PLUGIN_NAME,
+ "config": ActivePaymentGateway.CLIENT_CONFIG,
+ }
plugins = [
"tests.extensions.test_manager.SamplePlugin",
"tests.extensions.test_manager.ActivePaymentGateway",
"tests.extensions.test_manager.InactivePaymentGateway",
]
manager = ExtensionsManager(plugins=plugins)
- assert manager.list_payment_gateways() == [ActivePaymentGateway.PLUGIN_NAME]
+ assert manager.list_payment_gateways() == [expected_gateway]