def order(): return Order(100)
def test_order_discount_strategy_validate_error(): order = Order(10, discount_strategy=on_sale_discount) assert order.discount_strategy is None
def test_discount_apply_success(func, price, discount): order = Order(price, func) assert order.apply_discount() == discount
def test_order_discount_strategy_validate_success(func, price): order = Order(price, func) assert order.price == price assert order.discount_strategy == func