details: https://code.tryton.org/tryton/commit/accc85559275
branch: 7.6
user: Cédric Krier <[email protected]>
date: Sun Oct 19 10:43:23 2025 +0200
description:
Use a MagicMock with a return value when patching ModelStorage copy for
testing
Closes #14300
(grafted from 2f6936bc0970ec6108351380526af1d9015b79bb)
diffstat:
trytond/trytond/tests/test_tryton.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diffs (12 lines):
diff -r 6d803245a3e4 -r accc85559275 trytond/trytond/tests/test_tryton.py
--- a/trytond/trytond/tests/test_tryton.py Fri Oct 17 16:27:11 2025 +0200
+++ b/trytond/trytond/tests/test_tryton.py Sun Oct 19 10:43:23 2025 +0200
@@ -898,7 +898,7 @@
@with_transaction()
def test_modelstorage_copy(self):
"Test copied default values"
- copy = unittest.mock.Mock()
+ copy = unittest.mock.MagicMock(return_value=[])
with unittest.mock.patch.object(
ModelStorage, 'copy', new=classmethod(copy)):
for mname, model in Pool().iterobject():