def test_cancel_fulfillment(fulfilled_order): fulfillment = fulfilled_order.fulfillments.first() line_1 = fulfillment.lines.first() line_2 = fulfillment.lines.first() cancel_fulfillment(fulfillment, restock=False) assert fulfillment.status == FulfillmentStatus.CANCELED assert fulfilled_order.status == OrderStatus.UNFULFILLED assert line_1.order_line.quantity_fulfilled == 0 assert line_2.order_line.quantity_fulfilled == 0
def test_cancel_fulfillment(fulfilled_order): fulfillment = fulfilled_order.fulfillments.first() line_1 = fulfillment.lines.first() line_2 = fulfillment.lines.first() cancel_fulfillment(fulfillment, restock=False) assert fulfillment.status == FulfillmentStatus.CANCELED assert fulfilled_order.status == OrderStatus.UNFULFILLED assert line_1.order_line.quantity_fulfilled == 0 assert line_2.order_line.quantity_fulfilled == 0