X-Git-Url: https://plomlompom.com/repos/foo.html?a=blobdiff_plain;f=tests%2Ftodos.py;h=4bc1411b74cbddace9cf0a745527c0dcbb971b1d;hb=ffeee1618e4d169c9f125028ef7cd75b913cda8f;hp=b73f5d7fcb7b0a2c53256593e8e9867e86d2b89e;hpb=cd8664350b71bc116ea4cd5f4e48712a59dcf3ee;p=plomtask
diff --git a/tests/todos.py b/tests/todos.py
index b73f5d7..4bc1411 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()
@@ -54,16 +53,6 @@ class TestsWithDB(TestCaseWithDB, TestCaseSansDB):
self.assertEqual(todo_yes_id.enables, [])
self.assertEqual(todo_yes_id.disables, [])
- def test_Todo_by_id(self) -> None:
- """Test findability of Todos."""
- todo = Todo(1, self.proc, False, self.date1)
- todo.save(self.db_conn)
- self.assertEqual(Todo.by_id(self.db_conn, 1), todo)
- with self.assertRaises(NotFoundException):
- Todo.by_id(self.db_conn, 0)
- with self.assertRaises(NotFoundException):
- Todo.by_id(self.db_conn, 2)
-
def test_Todo_by_date(self) -> None:
"""Test findability of Todos by date."""
t1 = Todo(None, self.proc, False, self.date1)
@@ -202,14 +191,11 @@ class TestsWithDB(TestCaseWithDB, TestCaseSansDB):
self.assertEqual(len(todo_3.children), 1)
self.assertEqual(todo_3.children[0].process, proc4)
- def test_Todo_singularity(self) -> None:
- """Test pointers made for single object keep pointing to it."""
- self.check_singularity('is_done', True, self.proc, False, self.date1)
-
def test_Todo_remove(self) -> None:
"""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)
@@ -237,6 +223,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_