def test_equal_amounts_repayment_for_all_years(self):
        test_example = DebtExpenses(200000, 0.14, 4)
        req_sum = 0
        for i in range(1, 5, 1):
            _, expenses = test_example.equal_amounts_repayment(i)
            req_sum += expenses

        self.assertEqual(format(req_sum, '.0f'), '200000')
 def test_equal_amounts_repayment_for_invalid_neg_year(self):
     test_example = DebtExpenses(200000, 0.14, 4)
     with self.assertRaises(Exception):
         test_example.equal_amounts_repayment(-6)
 def test_equal_amounts_repayment_for_4_year(self):
     test_example = DebtExpenses(200000, 0.14, 4)
     payment, expenses = test_example.equal_amounts_repayment(4)
     self.assertEqual([format(payment, '.0f'),
                       format(expenses, '.0f')], ['57000', '50000'])