Skip to content

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

Add missing checks in unit test

Damian Wa939570cc2f9
diff --git a/tests/api/test_payment.py b/tests/api/test_payment.py
index b513f2e840..ad0466cd32 100644
--- a/tests/api/test_payment.py
+++ b/tests/api/test_payment.py
@@ -111,6 +111,18 @@ def test_checkout_add_payment_without_shipping_method_and_not_shipping_required(
content = get_graphql_content(response)
data = content["data"]["checkoutPaymentCreate"]
assert not data["paymentErrors"]
+ transactions = data["payment"]["transactions"]
+ assert not transactions
+ payment = Payment.objects.get()
+ assert payment.checkout == checkout
+ assert payment.is_active
+ assert payment.token == "sample-token"
+ assert payment.total == total.gross.amount
+ assert payment.currency == total.gross.currency
+ assert payment.charge_status == ChargeStatus.NOT_CHARGED
+ assert payment.billing_address_1 == checkout.billing_address.street_address_1
+ assert payment.billing_first_name == checkout.billing_address.first_name
+ assert payment.billing_last_name == checkout.billing_address.last_name
def test_checkout_add_payment_without_shipping_method_with_shipping_required(