Skip to content

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

Add test for restock_fulfillment_lines

IKarbowiak32a38e50f326
diff --git a/tests/test_order.py b/tests/test_order.py
index acaa4afe4f..ddb694633e 100644
--- a/tests/test_order.py
+++ b/tests/test_order.py
@@ -204,6 +204,10 @@ def test_restock_fulfillment_lines(fulfilled_order, warehouse):
stock_2_quantity_allocated_before = get_quantity_allocated_for_stock(stock_2)
stock_1_quantity_before = stock_1.quantity
stock_2_quantity_before = stock_2.quantity
+ order_line_1 = line_1.order_line
+ order_line_2 = line_2.order_line
+ order_line_1_quantity_fulfilled_before = order_line_1.quantity_fulfilled
+ order_line_2_quantity_fulfilled_before = order_line_2.quantity_fulfilled
restock_fulfillment_lines(fulfillment, warehouse)
@@ -217,6 +221,16 @@ def test_restock_fulfillment_lines(fulfilled_order, warehouse):
)
assert stock_1.quantity == stock_1_quantity_before + line_1.quantity
assert stock_2.quantity == stock_2_quantity_before + line_2.quantity
+ order_line_1.refresh_from_db()
+ order_line_2.refresh_from_db()
+ assert (
+ order_line_1.quantity_fulfilled
+ == order_line_1_quantity_fulfilled_before - line_1.quantity
+ )
+ assert (
+ order_line_2.quantity_fulfilled
+ == order_line_2_quantity_fulfilled_before - line_2.quantity
+ )
def test_update_order_status(fulfilled_order):