Skip to content

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

Fix test_split_mannual_discount to silent warning (#16771)

Piotr Zabieglikc25d3236c7e8
diff --git a/saleor/discount/tests/test_discounts.py b/saleor/discount/tests/test_discounts.py
index 3ea7466cc5..d8e2c1366a 100644
--- a/saleor/discount/tests/test_discounts.py
+++ b/saleor/discount/tests/test_discounts.py
@@ -713,10 +713,10 @@ def test_split_manual_discount(
draft_order_with_fixed_discount_order,
):
# given
- subtotal = Money(subtotal, currency="USD")
- shipping = Money(shipping_price, currency="USD")
+ subtotal = Money(Decimal(subtotal), currency="USD")
+ shipping = Money(Decimal(shipping_price), currency="USD")
discount = draft_order_with_fixed_discount_order.discounts.first()
- discount.value = value
+ discount.value = Decimal(value)
discount.value_type = value_type
# when
@@ -725,8 +725,8 @@ def test_split_manual_discount(
)
# then
- assert subtotal_discount == Money(subtotal_portion, "USD")
- assert shipping_discount == Money(shipping_portion, "USD")
+ assert subtotal_discount == Money(Decimal(subtotal_portion), "USD")
+ assert shipping_discount == Money(Decimal(shipping_portion), "USD")
def test_discount_info_for_logs(order_with_lines, voucher, order_promotion_with_rule):