def test_multi_month(self):
     task = CourseActivityMonthlyTask(end_date=datetime.date(2014, 1, 31),
                                      months=2)
     self.assertEquals(task.interval,
                       date_interval.Custom.parse('2013-11-01-2014-01-01'))
 def test_leap_year(self):
     task = CourseActivityMonthlyTask(end_date=datetime.date(2012, 2, 29),
                                      months=12)
     self.assertEquals(task.interval,
                       date_interval.Custom.parse('2011-02-01-2012-02-01'))
 def test_zero_months(self):
     task = CourseActivityMonthlyTask(end_date=datetime.date(2014, 1, 31),
                                      months=0)
     with self.assertRaises(ValueError):
         task.interval