From 7d56a7bf945b2a1288aefc6e07e7b001e9521ef2 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 : 6.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 49851b0a90..3ef4b6a2f2 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):