home · contact · privacy
Refactor ProcessStep code and undo replacement of implicit steps by explicit ones.
[plomtask] / tests / todos.py
index ecf2089a4b0544866004fdbb97521dbbc0b03fcf..c45171ac9488ed0eda2125c84689b042a85c8763 100644 (file)
@@ -1,7 +1,7 @@
 """Test Todos module."""
 from tests.utils import TestCaseWithDB, TestCaseWithServer
 from plomtask.todos import Todo, TodoNode
-from plomtask.processes import Process
+from plomtask.processes import Process, ProcessStep
 from plomtask.conditions import Condition
 from plomtask.exceptions import (NotFoundException, BadFormatException,
                                  HandledException)
@@ -167,11 +167,13 @@ class TestsWithDB(TestCaseWithDB):
         proc4.save(self.db_conn)
         assert isinstance(proc4.id_, int)
         # make proc4 step of proc3
-        proc3.set_steps(self.db_conn, [(None, proc4.id_, None)])
+        step = ProcessStep(None, proc3.id_, proc4.id_, None)
+        proc3.set_steps(self.db_conn, [step])
         # give proc2 three steps; 2× proc1, 1× proc3
-        proc2.set_steps(self.db_conn, [(None, self.proc.id_, None),
-                                       (None, self.proc.id_, None),
-                                       (None, proc3.id_, None)])
+        step1 = ProcessStep(None, proc2.id_, self.proc.id_, None)
+        step2 = ProcessStep(None, proc2.id_, self.proc.id_, None)
+        step3 = ProcessStep(None, proc2.id_, proc3.id_, None)
+        proc2.set_steps(self.db_conn, [step1, step2, step3])
         # test mere creation does nothing
         todo_ignore = Todo(None, proc2, False, self.date1)
         todo_ignore.save(self.db_conn)