def test_is_fully_paid_partially_paid(checkout_with_item, payment_dummy): checkout = checkout_with_item total = checkout.get_total() payment = payment_dummy payment.is_active = True payment.order = None payment.total = total.gross.amount - 1 payment.currency = total.gross.currency payment.checkout = checkout payment.save() is_paid = is_fully_paid(checkout, None, None) assert not is_paid
def test_is_fully_paid_partially_paid(cart_with_item, payment_dummy): checkout = cart_with_item total = checkout.get_total() payment = payment_dummy payment.is_active = True payment.order = None payment.total = total.gross.amount - 1 payment.currency = total.gross.currency payment.checkout = checkout payment.save() is_paid = is_fully_paid(checkout, None, None) assert not is_paid
def test_is_fully_paid_many_payments(cart_with_item, payment_dummy): checkout = cart_with_item total = checkout.get_total() payment = payment_dummy payment.is_active = True payment.order = None payment.total = total.gross.amount - 1 payment.currency = total.gross.currency payment.checkout = checkout payment.save() payment2 = payment_dummy payment2.pk = None payment2.is_active = True payment2.order = None payment2.total = 1 payment2.currency = total.gross.currency payment2.checkout = checkout payment2.save() is_paid = is_fully_paid(checkout) assert is_paid
def test_is_fully_paid_no_payment(checkout_with_item): checkout = checkout_with_item is_paid = is_fully_paid(checkout, None, None) assert not is_paid
def test_is_fully_paid_no_payment(cart_with_item): checkout = cart_with_item is_paid = is_fully_paid(checkout) assert not is_paid
def test_is_fully_paid_no_payment(cart_with_item): checkout = cart_with_item is_paid = is_fully_paid(checkout, None, None) assert not is_paid