def testExpired(self): "Dates in the past should be expired." now = datetime.datetime.now() month = now.month year = now.year - 2 expiry = ExpiryDate(month=month, year=year) assert expiry.is_expired()
def testNotExpired(self): "Dates in the future should be expired." now = datetime.datetime.now() month = now.month year = now.year + 2 expiry = ExpiryDate(month=month, year=year) self.assertFalse(expiry.is_expired())
def testTodayNotExpired(self): "Today should not be expired." now = datetime.datetime.now() expiry = ExpiryDate(month=now.month, year=now.year) self.assertFalse(expiry.is_expired())