Ejemplo n.º 1
0
def test_transaction_list_must_include_all_destinations(session):
    acc1 = create_account(session)
    acc2 = create_account(session)
    acc3 = create_account(session, parent=acc2)
    session.commit()

    session.add(create_transaction(acc1, acc3, 100.0))
    session.commit()

    acc1_tid = acc1.tid
    acc2_tid = acc2.tid
    acc3_tid = acc3.tid
    session.expunge_all()

    result = transactions(session, acc3_tid).one()
    assert result.from_accs == [acc1_tid]
    assert result.to_accs == [acc2_tid, acc3_tid]

    result = transactions(session, acc3_tid, income=True).one()
    assert result.from_accs == [acc1_tid]
    assert result.to_accs == [acc2_tid, acc3_tid]
Ejemplo n.º 2
0
 def transactions(self, date_from=None, date_to=None, income=False, outcome=False):
     return transactions(object_session(self), self.tid, date_from, date_to, income, outcome)