示例#1
0
    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())
示例#2
0
    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())