def end_date(): return str2date('2020-01-01')
def start_date(): return str2date('2019-12-01')
def payment_date(): return str2date('2019-12-05')
def test_get_balance(loan): assert loan.get_balance(str2date('2020-12-01')) == Money('1098.82')
def test_add_payment(loan): loan.add_payment(Payment(amount=Money('110'), date=str2date('2020-01-01'))) assert loan.get_balance(str2date('2020-01-01')) == Money('898.37')
def payment(): return Payment(Money('1000'), str2date('2020-01-01'))
def loan(): return Loan(Money('1000'), 13, str2date('2019-11-23'))