def testCannotBeRenewed(self): record = LoanRecord( title="Blah", link="http://foo.com", times_renewed=3, due_date=datetime.date.today() ) self.assertFalse(record.can_be_renewed())
def testLoanIsOverdue(self): record = LoanRecord( title="Blah", link="http://foo.com", times_renewed=0, due_date=datetime.date.today() - datetime.timedelta(days=1) ) self.assertTrue(record.is_coming_due()) self.assertTrue(record.is_overdue())