self.post_process(1, form_data_1)
retrieved_process = Process.by_id(self.db_conn, 1)
self.assertEqual(len(retrieved_process.explicit_steps), 2)
- retrieved_step_0 = retrieved_process.explicit_steps[0]
+ retrieved_step_0 = retrieved_process.explicit_steps[1]
self.assertEqual(retrieved_step_0.step_process_id, 3)
self.assertEqual(retrieved_step_0.owner_id, 1)
self.assertEqual(retrieved_step_0.parent_step_id, None)
- retrieved_step_1 = retrieved_process.explicit_steps[1]
+ retrieved_step_1 = retrieved_process.explicit_steps[0]
self.assertEqual(retrieved_step_1.step_process_id, 2)
self.assertEqual(retrieved_step_1.owner_id, 1)
self.assertEqual(retrieved_step_1.parent_step_id, None)
self.post_process(1, form_data_1)
retrieved_process = Process.by_id(self.db_conn, 1)
self.assertEqual(len(retrieved_process.explicit_steps), 3)
- retrieved_step_0 = retrieved_process.explicit_steps[0]
+ retrieved_step_0 = retrieved_process.explicit_steps[1]
self.assertEqual(retrieved_step_0.step_process_id, 2)
self.assertEqual(retrieved_step_0.owner_id, 1)
self.assertEqual(retrieved_step_0.parent_step_id, None)
- retrieved_step_1 = retrieved_process.explicit_steps[1]
+ retrieved_step_1 = retrieved_process.explicit_steps[0]
self.assertEqual(retrieved_step_1.step_process_id, 3)
self.assertEqual(retrieved_step_1.owner_id, 1)
self.assertEqual(retrieved_step_1.parent_step_id, None)
form_data = {'day_comment': '', 'make_type': 'full'}
self.check_post(form_data, '/day?date=2024-01-01&make_type=full', 302)
self.assertEqual(Todo.by_date(self.db_conn, '2024-01-01'), [])
+ proc = Process.by_id(self.db_conn, 1)
form_data['new_todo'] = str(proc.id_)
self.check_post(form_data, '/day?date=2024-01-01&make_type=full', 302)
todos = Todo.by_date(self.db_conn, '2024-01-01')
self.assertEqual(1, len(todos))
todo1 = todos[0]
self.assertEqual(todo1.id_, 1)
+ proc = Process.by_id(self.db_conn, 1)
self.assertEqual(todo1.process.id_, proc.id_)
self.assertEqual(todo1.is_done, False)
+ proc2 = Process.by_id(self.db_conn, 2)
form_data['new_todo'] = str(proc2.id_)
self.check_post(form_data, '/day?date=2024-01-01&make_type=full', 302)
todos = Todo.by_date(self.db_conn, '2024-01-01')
todo1 = todos[1]
self.assertEqual(todo1.id_, 2)
+ proc2 = Process.by_id(self.db_conn, 1)
+ todo1 = Todo.by_date(self.db_conn, '2024-01-01')[0]
+ self.assertEqual(todo1.id_, 1)
self.assertEqual(todo1.process.id_, proc2.id_)
self.assertEqual(todo1.is_done, False)
form_data = {'day_comment': '', 'todo_id': [1], 'make_type': 'full',
'comment': [''], 'done': [], 'effort': ['']}
self.check_post(form_data, '/day?date=2024-01-01&make_type=full', 302)
+ todo = Todo.by_date(self.db_conn, '2024-01-01')[0]
self.assertEqual(todo.is_done, False)
form_data = {'day_comment': '', 'todo_id': [1], 'done': [1],
'make_type': 'full', 'comment': [''], 'effort': ['']}
self.check_post(form_data, '/day?date=2024-01-01&make_type=full', 302)
+ todo = Todo.by_date(self.db_conn, '2024-01-01')[0]
self.assertEqual(todo.is_done, True)
def test_do_GET_todo(self) -> None: