home
·
contact
·
privacy
projects
/
plomtask
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Refactor saving and caching tests, treatment of None IDs.
[plomtask]
/
tests
/
todos.py
diff --git
a/tests/todos.py
b/tests/todos.py
index b73f5d7fcb7b0a2c53256593e8e9867e86d2b89e..7632f39cf3b75674036452b609c7e90b3f379e34 100644
(file)
--- a/
tests/todos.py
+++ b/
tests/todos.py
@@
-202,14
+202,11
@@
class TestsWithDB(TestCaseWithDB, TestCaseSansDB):
self.assertEqual(len(todo_3.children), 1)
self.assertEqual(todo_3.children[0].process, proc4)
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)
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)
todo_0 = Todo(None, self.proc, False, self.date1)
todo_0.save(self.db_conn)
todo_0.add_child(todo_1)
@@
-237,6
+234,7
@@
class TestsWithDB(TestCaseWithDB, TestCaseSansDB):
todo_1.comment = 'foo'
todo_1.effort = -0.1
todo_1.save(self.db_conn)
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_
Todo.by_id(self.db_conn, todo_1.id_)
todo_1.comment = ''
todo_1_id = todo_1.id_