def test_add_months(self): date_start_1 = datetime.date(2012, 01, 01) date_end_1 = add_months(date_start_1, 1) self.assertEqual(date_end_1, datetime.date(2012, 02, 01)) date_start_2 = datetime.date(2011, 12, 29) date_end_2 = add_months(date_start_2, 2) self.assertEqual(date_end_2, datetime.date(2012, 02, 29))
def keep_until(self): from palco.contrib import add_months if self.last: return add_months(self.last, self.MONTHS_KEEP_UNTIL) else: return None
def expires(self): from palco.contrib import add_months return add_months(self.last, self.MONTHS_EXPIRES)