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