Commit 9ee7c591 authored by Bram Schoenmakers's avatar Bram Schoenmakers

Suppress pylint E1103 false positives.

pylint doesn't understand that <date> - <timedelta> results in a date,
but thinks it results in a timedelta. Since timedelta has no isoformat()
method, it will complain.
parent 4601a175
......@@ -88,6 +88,7 @@ class PostponeCommandTest(CommandTest):
start = self.start + timedelta(7)
self.assertTrue(self.todolist.is_dirty())
# pylint: disable=E1103
self.assertEqual(self.output, "| 3| Baz due:{} t:{}\n".format(due.isoformat(), start.isoformat()))
self.assertEqual(self.errors, "")
......@@ -108,6 +109,7 @@ class PostponeCommandTest(CommandTest):
due = self.future + timedelta(7)
self.assertTrue(self.todolist.is_dirty())
# pylint: disable=E1103
self.assertEqual(self.output, "| 5| Future due:{} t:{}\n".format(due.isoformat(), self.future_start.isoformat()))
self.assertEqual(self.errors, "")
......@@ -119,6 +121,7 @@ class PostponeCommandTest(CommandTest):
start = self.future_start + timedelta(7)
self.assertTrue(self.todolist.is_dirty())
# pylint: disable=E1103
self.assertEqual(self.output, "| 5| Future due:{} t:{}\n".format(due.isoformat(), start.isoformat()))
self.assertEqual(self.errors, "")
......@@ -192,6 +195,7 @@ class PostponeCommandTest(CommandTest):
start = self.start + timedelta(7)
self.assertTrue(self.todolist.is_dirty())
# pylint: disable=E1103
self.assertEqual(self.output, "| 2| Bar due:{}\n| 3| Baz due:{} t:{}\n".format(due.isoformat(), due.isoformat(), start.isoformat()))
self.assertEqual(self.errors, "")
......
......@@ -117,6 +117,7 @@ class RecurrenceTest(TopydoTest):
due = date.today() - timedelta(1)
self.todo.set_tag(config().tag_due(), date.today().isoformat())
yesterday = due - timedelta(1)
# pylint: disable=E1103
self.todo.set_tag(config().tag_start(), yesterday.isoformat())
new_start = date.today() + timedelta(5)
......
......@@ -68,8 +68,10 @@ class PostponeCommand(MultiCommand):
if self.move_start_date and todo.has_tag(config().tag_start()):
length = todo.length()
new_start = new_due - timedelta(length)
# pylint: disable=E1103
todo.set_tag(config().tag_start(), new_start.isoformat())
# pylint: disable=E1103
todo.set_tag(config().tag_due(), new_due.isoformat())
self.todolist.set_dirty()
......
......@@ -47,6 +47,7 @@ def _advance_recurring_todo_helper(p_todo, p_offset):
if not new_due:
raise NoRecurrenceException()
# pylint: disable=E1103
todo.set_tag(config().tag_due(), new_due.isoformat())
if todo.start_date():
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment