Skip to content

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

Fix tests

fowczarekf6532dbed7f9
diff --git a/tests/api/test_checkout_promo_codes.py b/tests/api/test_checkout_promo_codes.py
index 49969a7fa0..058d8fe6f1 100644
--- a/tests/api/test_checkout_promo_codes.py
+++ b/tests/api/test_checkout_promo_codes.py
@@ -307,10 +307,10 @@ def test_checkout_add_voucher_code(api_client, checkout_with_item, voucher):
def test_checkout_add_voucher_code_checkout_with_sale(
- api_client, checkout_with_item, voucher_percentage, sale
+ api_client, checkout_with_item, voucher_percentage, discount_info
):
assert checkout_with_item.get_subtotal() > checkout_with_item.get_subtotal(
- discounts=[sale]
+ discounts=[discount_info]
)
checkout_id = graphene.Node.to_global_id("Checkout", checkout_with_item.pk)
variables = {"checkoutId": checkout_id, "promoCode": voucher_percentage.code}
diff --git a/tests/test_checkout.py b/tests/test_checkout.py
index c6401e507b..83537e603f 100644
--- a/tests/test_checkout.py
+++ b/tests/test_checkout.py
@@ -1236,13 +1236,13 @@ def test_recalculate_checkout_discount(
def test_recalculate_checkout_discount_with_sale(
- checkout_with_voucher_percentage, sale
+ checkout_with_voucher_percentage, discount_info
):
checkout = checkout_with_voucher_percentage
- recalculate_checkout_discount(checkout_with_voucher_percentage, [sale], None)
+ recalculate_checkout_discount(checkout, [discount_info], None)
assert checkout.discount_amount == Money("1.50", "USD")
total = TaxedMoney(net=Money("13.50", "USD"), gross=Money("13.50", "USD"))
- assert checkout.get_total(discounts=[sale]) == total
+ assert checkout.get_total(discounts=[discount_info]) == total
def test_recalculate_checkout_discount_voucher_not_applicable(