X-Git-Url: https://plomlompom.com/repos/%7B%7Bprefix%7D%7D/copy_structured?a=blobdiff_plain;f=tests%2Ftodos.py;h=51297a8ceadc1812713a681489cc718814b7f066;hb=bdb93117ce0f2b08b7b70cf43ac086afa4689c0f;hp=56aaf48ccc1faa917b23fd89443678efa049c396;hpb=02aa60b59cea2c0401efd785f3bb5d06aec7bf4d;p=plomtask diff --git a/tests/todos.py b/tests/todos.py index 56aaf48..51297a8 100644 --- a/tests/todos.py +++ b/tests/todos.py @@ -10,8 +10,8 @@ from plomtask.exceptions import (NotFoundException, BadFormatException, class TestsWithDB(TestCaseWithDB, TestCaseSansDB): """Tests requiring DB, but not server setup. - NB: We subclass TestCaseSansDB too, to pull in its .test_id_setting, which - for Todo wouldn't run without a DB being set up due to the need for + NB: We subclass TestCaseSansDB too, to pull in its .test_id_validation, + which for Todo wouldn't run without a DB being set up due to the need for Processes with set IDs. """ checked_class = Todo @@ -19,7 +19,6 @@ class TestsWithDB(TestCaseWithDB, TestCaseSansDB): 'date': '2024-01-01'} # solely used for TestCaseSansDB.test_id_setting default_init_args = [None, False, '2024-01-01'] - do_id_test = True def setUp(self) -> None: super().setUp() @@ -206,6 +205,7 @@ class TestsWithDB(TestCaseWithDB, TestCaseSansDB): """Test removal.""" todo_1 = Todo(None, self.proc, False, self.date1) todo_1.save(self.db_conn) + assert todo_1.id_ is not None todo_0 = Todo(None, self.proc, False, self.date1) todo_0.save(self.db_conn) todo_0.add_child(todo_1) @@ -233,6 +233,7 @@ class TestsWithDB(TestCaseWithDB, TestCaseSansDB): todo_1.comment = 'foo' todo_1.effort = -0.1 todo_1.save(self.db_conn) + assert todo_1.id_ is not None Todo.by_id(self.db_conn, todo_1.id_) todo_1.comment = '' todo_1_id = todo_1.id_