From 8044956aafa85d7d7e6320ced518d6d86ca8c4ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sat, 20 Sep 2025 09:07:18 +0200 Subject: [PATCH] Patch global PATH variable of filestore in test Changing the configuration value is not enough as its value is cached in the global variable. Closes #14248 (grafted from 2967a503290b9b6d724a1da46b80523e75536179) --HG-- branch : 7.0 --- trytond/trytond/tests/test_filestore.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/trytond/trytond/tests/test_filestore.py b/trytond/trytond/tests/test_filestore.py index 4d551bb6de..63d699d5e3 100644 --- a/trytond/trytond/tests/test_filestore.py +++ b/trytond/trytond/tests/test_filestore.py @@ -17,7 +17,10 @@ class FileStoreTestCase(unittest.TestCase): path = config.get('database', 'path') dtemp = tempfile.mkdtemp() config.set('database', 'path', dtemp) + patcher = patch('trytond.filestore.PATH', dtemp) + patcher.start() self.addCleanup(config.set, 'database', 'path', path) + self.addCleanup(patcher.stop) self.addCleanup(shutil.rmtree, dtemp) def data(self):