mirror of
https://github.com/topydo/topydo.git
synced 2024-05-20 13:58:33 +00:00
Respect auto_creation_date when advancing recurring tasks
This commit is contained in:
parent
f327250e01
commit
7206d6c7ed
2
test/data/docommand.conf
Normal file
2
test/data/docommand.conf
Normal file
|
@ -0,0 +1,2 @@
|
|||
[add]
|
||||
auto_creation_date = 0
|
|
@ -18,6 +18,7 @@ import unittest
|
|||
from datetime import date, timedelta
|
||||
|
||||
from topydo.commands.DoCommand import DoCommand
|
||||
from topydo.lib.Config import config
|
||||
from topydo.lib.TodoList import TodoList
|
||||
|
||||
from .command_testcase import CommandTest
|
||||
|
@ -169,6 +170,16 @@ The following todo item(s) became active:
|
|||
| 12| {today} Strict due:2014-01-02 rec:1d\n""".format(today=self.today)
|
||||
self.assertEqual(self.output, result)
|
||||
|
||||
def test_recurrence_no_creation_date(self):
|
||||
config("test/data/docommand.conf")
|
||||
|
||||
self._recurrence_helper(["4"])
|
||||
|
||||
result = """Completed: x {today} Recurring! rec:1d
|
||||
The following todo item(s) became active:
|
||||
| 12| Recurring! rec:1d due:{tomorrow}\n""".format(today=self.today, tomorrow=self.tomorrow)
|
||||
self.assertEqual(self.output, result)
|
||||
|
||||
def test_invalid1(self):
|
||||
command = DoCommand(["99"], self.todolist, self.out, self.error)
|
||||
command.execute()
|
||||
|
|
|
@ -68,6 +68,7 @@ def advance_recurring_todo(p_todo, p_offset=None, p_strict=False):
|
|||
new_start = new_due - timedelta(length)
|
||||
todo.set_tag(config().tag_start(), new_start.isoformat())
|
||||
|
||||
todo.set_creation_date(date.today())
|
||||
if config().auto_creation_date():
|
||||
todo.set_creation_date(date.today())
|
||||
|
||||
return todo
|
||||
|
|
Loading…
Reference in a new issue