def test_custom_explanation(self): """ Test that the custom explanation is added to the default explanation. """ now = datetime.datetime.now() start = now - datetime.timedelta(days=10) end = now + datetime.timedelta(days=10) target = DynamicTechnicalDebtTarget(200, start, 100, end, 'Extra.') self.assertEqual( 'Het doel is dat de technische schuld vermindert van {0} op {1} naar {2} op {3}. ' 'De op dit moment geaccepteerde technische schuld is {4}. Extra.'. format(200, format_date(start, year=True), 100, format_date(end, year=True), target.target_value()), target.explanation())
def test_default_explanation(self): """ Test that the default explanation shows the period. """ now = datetime.datetime.now() start = now - datetime.timedelta(days=10) end = now + datetime.timedelta(days=10) target = DynamicTechnicalDebtTarget(200, start, 100, end) self.assertEqual( 'Het doel is dat de technische schuld vermindert van {0} LOC op {1} naar {2} LOC op {3}. ' 'De op dit moment geaccepteerde technische schuld is {4} LOC.'. format(200, format_date(start, year=True), 100, format_date(end, year=True), target.target_value()), target.explanation('LOC'))