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
This commit is contained in:
Cédric Krier committed 2025-09-20 09:07:18 +02:00
1 parent de61264a9f
commit 7d56a7bf94
1 file changed
+3
+3
View File
@@ -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):