Beispiel #1
0
 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)
Beispiel #2
0
 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
Beispiel #3
0
 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)
Beispiel #4
0
 def test_time_parse_fail(self):
     with pytest.raises(todo.InvalidDateException):
         todo.parse_date("Parse This!")
Beispiel #5
0
 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
Beispiel #6
0
 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
Beispiel #7
0
 def test_time_parse_5_days(self):
     five_days = datetime.date.today() + datetime.timedelta(days=5)
     assert todo.parse_date("5 days") == five_days
Beispiel #8
0
 def test_time_parse_week(self):
     week = datetime.date.today() + datetime.timedelta(days=7)
     assert todo.parse_date("1 week") == week
Beispiel #9
0
 def test_time_parse_day(self):
     tomorrow = datetime.date.today() + datetime.timedelta(days=1)
     assert todo.parse_date("1 day") == tomorrow
Beispiel #10
0
 def test_time_parse_today(self):
     today = datetime.date.today()
     assert todo.parse_date("today") == today