X-Git-Url: https://plomlompom.com/repos/?a=blobdiff_plain;f=tests%2Ftodos.py;h=9317c398b255c51b14046f888b3de4a24b70238d;hb=c5449a0b00f8865b1129ed56bdd16f1cc055bc87;hp=1a9eab61c0f77932c11b24ebae15cfc9a982287b;hpb=b4a34a415fb31a00ee1e092fcc2a6b5d97edd52a;p=plomtask diff --git a/tests/todos.py b/tests/todos.py index 1a9eab6..9317c39 100644 --- a/tests/todos.py +++ b/tests/todos.py @@ -187,9 +187,9 @@ class TestsWithDB(TestCaseWithDB): todo_2 = Todo.create_with_children(self.db_conn, proc2.id_, self.date1) self.assertEqual(3, len(todo_2.children)) self.assertEqual(todo_1, todo_2.children[0]) - self.assertEqual(self.proc, todo_2.children[1].process) - self.assertEqual(proc3, todo_2.children[2].process) - todo_3 = todo_2.children[2] + self.assertEqual(self.proc, todo_2.children[2].process) + self.assertEqual(proc3, todo_2.children[1].process) + todo_3 = todo_2.children[1] self.assertEqual(len(todo_3.children), 1) self.assertEqual(todo_3.children[0].process, proc4) @@ -207,9 +207,10 @@ class TestsWithDB(TestCaseWithDB): todo_2 = Todo(None, self.proc, False, self.date1) todo_2.save(self.db_conn) todo_1.add_child(todo_2) + todo_1_id = todo_1.id_ todo_1.remove(self.db_conn) with self.assertRaises(NotFoundException): - Todo.by_id(self.db_conn, todo_1.id_) + Todo.by_id(self.db_conn, todo_1_id) self.assertEqual(todo_0.children, []) self.assertEqual(todo_2.parents, []) todo_2.comment = 'foo' @@ -229,9 +230,10 @@ class TestsWithDB(TestCaseWithDB): todo_1.save(self.db_conn) Todo.by_id(self.db_conn, todo_1.id_) todo_1.comment = '' + todo_1_id = todo_1.id_ todo_1.save(self.db_conn) with self.assertRaises(NotFoundException): - Todo.by_id(self.db_conn, todo_1.id_) + Todo.by_id(self.db_conn, todo_1_id) class TestsWithServer(TestCaseWithServer): @@ -397,7 +399,7 @@ class TestsWithServer(TestCaseWithServer): def test_do_POST_day_todo_doneness(self) -> None: """Test Todo doneness can be posted to Day view.""" - form_data = self.post_process() + self.post_process() form_data = {'day_comment': '', 'new_todo': [1], 'make_type': 'full'} 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]