tests: Add a test case for flawed due date

This commit is contained in:
Tomas Babej 2015-12-27 16:04:52 +01:00
parent 947090ce52
commit f9dedc1dbc

View file

@ -111,6 +111,28 @@ class TestSimpleTaskWithDueDatetimeCreation(IntegrationTest):
assert task['due'] == local_zone.localize(due) assert task['due'] == local_zone.localize(due)
class TestSimpleTaskWithFlawedDueDatetimeCreation(IntegrationTest):
viminput = """
* [ ] This is a test task (2015-94-53 12:00)
"""
vimoutput = """
* [ ] This is a test task #{uuid}
"""
def execute(self):
self.command("w", regex="Invalid timestamp", lines=2)
# Check that only one tasks with this description exists
assert len(self.tw.tasks.pending()) == 1
task = self.tw.tasks.pending()[0]
assert task['description'] == 'This is a test task'
assert task['status'] == 'pending'
assert task['due'] == None
class TestSimpleTaskWithDueDateCreation(IntegrationTest): class TestSimpleTaskWithDueDateCreation(IntegrationTest):
viminput = """ viminput = """