def test_charge_log_transaction_no_unpaid(self, monkeypatch): group = Group() monkeypatch.setattr(Group, 'amount_unpaid', 0) charge = Charge(targets=[group], amount=1000, description="Test charge") charge.response = stripe.Charge(id=10) txn = charge.stripe_transaction_from_charge() result = charge.stripe_transaction_for_model(group, txn) assert result.group_id == group.id assert result.txn_id == txn.id assert result.share == 1000
def test_charge_log_transaction_attendee(self, monkeypatch): attendee = Attendee() monkeypatch.setattr(Attendee, 'amount_unpaid', 10) charge = Charge(targets=[attendee], description="Test charge") charge.response = stripe.Charge(id=10) txn = charge.stripe_transaction_from_charge() result = charge.stripe_transaction_for_model(attendee, txn) assert result.attendee_id == attendee.id assert result.txn_id == txn.id assert result.share == 1000