+ def test_do_POST_day_todo_multiple(self) -> None:
+ """Test multiple Todos can be posted to Day view."""
+ form_data = self.post_process()
+ form_data = self.post_process(2)
+ form_data = {'comment': '', 'new_todo': [1, 2]}
+ self.check_post(form_data, '/day?date=2024-01-01', 302)
+ todo1 = Todo.by_date(self.db_conn, '2024-01-01')[0]
+ todo2 = Todo.by_date(self.db_conn, '2024-01-01')[1]
+ self.assertEqual(todo1.process.id_, 1)
+ self.assertEqual(todo2.process.id_, 2)
+
+ def test_do_POST_day_todo_multiple_inner_adoption(self) -> None:
+ """Test multiple Todos can be posted to Day view w. inner adoption."""
+ form_data = self.post_process()
+ form_data = self.post_process(2, form_data | {'new_top_step': 1})
+ form_data = {'comment': '', 'new_todo': [1, 2]}
+ self.check_post(form_data, '/day?date=2024-01-01', 302)
+ todo1 = Todo.by_date(self.db_conn, '2024-01-01')[0]
+ todo2 = Todo.by_date(self.db_conn, '2024-01-01')[1]
+ self.assertEqual(todo1.children, [])
+ self.assertEqual(todo1.parents, [todo2])
+ self.assertEqual(todo2.children, [todo1])
+ self.assertEqual(todo2.parents, [])
+ # check process ID order does not affect end result
+ form_data = {'comment': '', 'new_todo': [2, 1]}
+ self.check_post(form_data, '/day?date=2024-01-02', 302)
+ todo1 = Todo.by_date(self.db_conn, '2024-01-02')[1]
+ todo2 = Todo.by_date(self.db_conn, '2024-01-02')[0]
+ self.assertEqual(todo1.children, [])
+ self.assertEqual(todo1.parents, [todo2])
+ self.assertEqual(todo2.children, [todo1])
+ self.assertEqual(todo2.parents, [])
+