Enable multiple SETUP files for tests.
@@ -214,11 +214,17 @@ class DatabaseTestCase(ConnectedTestCase):
script += f'\nCOMMIT MIGRATION {module_name}::d1;'
if cls.SETUP:
- if '\n' not in cls.SETUP and os.path.exists(cls.SETUP):
- with open(cls.SETUP, 'rt') as f:
+ if not isinstance(cls.SETUP, (list, tuple)):
+ scripts = [cls.SETUP]
+ else:
+ scripts = cls.SETUP
+
+ for scr in scripts:
+ if '\n' not in scr and os.path.exists(scr):
+ with open(scr, 'rt') as f:
setup = f.read()
else:
- setup = cls.SETUP
+ setup = scr
script += '\n' + setup
