Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Rename can_be_fully_paid to is_fully_paid
Unknown3b0617a0660a
diff --git a/saleor/checkout/utils.py b/saleor/checkout/utils.pyindex 7323031065..7a4a5f6423 100644--- a/saleor/checkout/utils.py+++ b/saleor/checkout/utils.py@@ -880,7 +880,7 @@ def create_order(cart: Cart, tracking_code: str, discounts, taxes):return order-def can_be_fully_paid(cart: Cart, taxes, discounts):+def is_fully_paid(cart: Cart, taxes, discounts):"""Check if provided payment methods cover the checkout's total amount.Note that these payments may not be captured or charged at all."""payments = [@@ -906,7 +906,7 @@ def ready_to_place_order(cart: Cart, taxes, discounts):if not cart.billing_address:return False, pgettext_lazy('order placement_error', 'Billing address is not set')- if not can_be_fully_paid(cart, taxes, discounts):+ if not is_fully_paid(cart, taxes, discounts):return False, pgettext_lazy('order placement error', ('Provided payment methods can not 'diff --git a/tests/api/test_checkout.py b/tests/api/test_checkout.pyindex d5a1a69b56..d68a7dd506 100644--- a/tests/api/test_checkout.py+++ b/tests/api/test_checkout.py@@ -6,7 +6,7 @@ import pytestfrom saleor.checkout.models import Cartfrom saleor.checkout.utils import (- add_voucher_to_cart, can_be_fully_paid, ready_to_place_order)+ add_voucher_to_cart, is_fully_paid, ready_to_place_order)from saleor.graphql.core.utils import str_to_enumfrom saleor.order.models import Orderfrom tests.api.utils import get_graphql_content@@ -1179,11 +1179,11 @@ def test_is_fully_paid(cart_with_item, payment_dummy):payment.currency = total.gross.currencypayment.checkout = checkoutpayment.save()- is_paid = can_be_fully_paid(checkout, None, None)+ is_paid = is_fully_paid(checkout, None, None)assert is_paid-def test_can_be_fully_paid_many_payments(cart_with_item, payment_dummy):+def test_is_fully_paid_many_payments(cart_with_item, payment_dummy):checkout = cart_with_itemtotal = checkout.get_total()payment = payment_dummy@@ -1201,11 +1201,11 @@ def test_can_be_fully_paid_many_payments(cart_with_item, payment_dummy):payment2.currency = total.gross.currencypayment2.checkout = checkoutpayment2.save()- is_paid = can_be_fully_paid(checkout, None, None)+ is_paid = is_fully_paid(checkout, None, None)assert is_paid-def test_can_be_fully_paid_partially_paid(cart_with_item, payment_dummy):+def test_is_fully_paid_partially_paid(cart_with_item, payment_dummy):checkout = cart_with_itemtotal = checkout.get_total()payment = payment_dummy@@ -1215,13 +1215,13 @@ def test_can_be_fully_paid_partially_paid(cart_with_item, payment_dummy):payment.currency = total.gross.currencypayment.checkout = checkoutpayment.save()- is_paid = can_be_fully_paid(checkout, None, None)+ is_paid = is_fully_paid(checkout, None, None)assert not is_paid-def test_can_be_fully_paid_no_payment(cart_with_item):+def test_is_fully_paid_no_payment(cart_with_item):checkout = cart_with_item- is_paid = can_be_fully_paid(checkout, None, None)+ is_paid = is_fully_paid(checkout, None, None)assert not is_paid