def expired(self): """Returns whether or not this banner has expired. A banner has expired if it has an expiration date, and that expiration date has passed. """ return date_has_passed(self.publish_until)
def test_date_has_passed(self): self.assertFalse(date_has_passed(None)) self.assertTrue(date_has_passed(date(2012, 1, 1))) self.assertFalse(date_has_passed(date.today()))