Skip to content

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

Update getting authorized amount based on multiple partial capture is not supported

Unknown712abb6fe6a9
diff --git a/tests/test_payment.py b/tests/test_payment.py
index 44ebfd9fca..16d149239b 100644
--- a/tests/test_payment.py
+++ b/tests/test_payment.py
@@ -697,12 +697,18 @@ def test_can_refund(payment_dummy: Payment):
def test_payment_get_authorized_amount(payment_txn_preauth):
- authorized_amount = payment_txn_preauth.transactions.first().amount
- assert payment_txn_preauth.get_authorized_amount().amount == \
- authorized_amount
- assert payment_txn_preauth.order.total_authorized.amount == \
- authorized_amount
+ payment = payment_txn_preauth
+ authorized_amount = payment.transactions.first().amount
+ assert payment.get_authorized_amount().amount == authorized_amount
+ assert payment.order.total_authorized.amount == authorized_amount
- payment_txn_preauth.transactions.all().delete()
- assert payment_txn_preauth.get_authorized_amount().amount == Decimal(0)
+ payment.transactions.create(
+ amount=payment.total,
+ kind=TransactionKind.CAPTURE,
+ gateway_response={},
+ is_success=True)
+ assert payment.get_authorized_amount().amount == Decimal(0)
+
+ payment.transactions.all().delete()
+ assert payment.get_authorized_amount().amount == Decimal(0)