question 392 Software Architecture · easy
Fix the late fee that depends on today's date
late_fee gives different answers depending on the day the tests run: it reads the real clock inside the business rule. Make the rule pure: it should take today as a parameter (a date), and keep the fee rules unchanged.
Function
late_fee(due, today); both are datetime.date objectsRule0 if returned on or before the due date; otherwise 1.50 per day late, at most 15.00