def test_add_content_category_and_due(self): reminder = self.add_helper( {"content": "New reminder content", "category": "cats are evil", "date_due": "2 weeks", "date": None} ) reminder.date_due = todo.parse_date("2 weeks") assert todo.reminder_exists(reminder)
def test_time_parse_month_day_year(self): time = datetime.date(2013, 3, 8) assert todo.parse_date("3/8/2013") == time assert todo.parse_date("3-8-2013") == time assert todo.parse_date("3.8.2013") == time
def test_add_content_and_due(self): reminder = self.add_helper( {"content": "New reminder content", "category": None, "date_due": "today", "date": None} ) reminder.date_due = todo.parse_date("today") assert todo.reminder_exists(reminder)
def test_time_parse_fail(self): with pytest.raises(todo.InvalidDateException): todo.parse_date("Parse This!")
def test_time_parse_month_day(self): year = datetime.date.today().year time = datetime.date(year, 3, 8) assert todo.parse_date("3/8") == time assert todo.parse_date("3-8") == time assert todo.parse_date("3.8") == time
def test_time_parse_5_weeks(self): five_weeks = datetime.date.today() + (5 * datetime.timedelta(days=7)) assert todo.parse_date("5 weeks") == five_weeks
def test_time_parse_5_days(self): five_days = datetime.date.today() + datetime.timedelta(days=5) assert todo.parse_date("5 days") == five_days
def test_time_parse_week(self): week = datetime.date.today() + datetime.timedelta(days=7) assert todo.parse_date("1 week") == week
def test_time_parse_day(self): tomorrow = datetime.date.today() + datetime.timedelta(days=1) assert todo.parse_date("1 day") == tomorrow
def test_time_parse_today(self): today = datetime.date.today() assert todo.parse_date("today") == today