Ejemplo n.º 1
0
def order():
    return Order(100)
Ejemplo n.º 2
0
def test_order_discount_strategy_validate_error():
    order = Order(10, discount_strategy=on_sale_discount)

    assert order.discount_strategy is None
Ejemplo n.º 3
0
def test_discount_apply_success(func, price, discount):
    order = Order(price, func)

    assert order.apply_discount() == discount
Ejemplo n.º 4
0
def test_order_discount_strategy_validate_success(func, price):
    order = Order(price, func)

    assert order.price == price
    assert order.discount_strategy == func