Revision fc7747df7177f2f610c55c9709a81e7b0b618806 authored by Jochen Kupperschmidt on 03 January 2026, 00:21:02 UTC, committed by Jochen Kupperschmidt on 03 January 2026, 00:21:02 UTC
1 parent 2e587a4
test_cart_emptiness.py
"""
:Copyright: 2014-2025 Jochen Kupperschmidt
:License: Revised BSD (see `LICENSE` file for details)
"""
from moneyed import EUR
from byceps.services.shop.cart.models import Cart
def test_is_empty_without_items():
cart = create_empty_cart()
assert cart.is_empty()
def test_is_empty_with_one_item(make_product):
cart = create_empty_cart()
cart.add_item(make_product(), 1)
assert not cart.is_empty()
def test_is_empty_with_multiple_items(make_product):
cart = create_empty_cart()
cart.add_item(make_product(), 3)
cart.add_item(make_product(), 1)
cart.add_item(make_product(), 6)
assert not cart.is_empty()
# helpers
def create_empty_cart() -> Cart:
return Cart(EUR)

Computing file changes ...