Fix tests loading local pretix.cfg (#6705)

test/sqlite.cfg does not exist, so pretix.testutils.settings never set PRETIX_CONFIG_FILE, leading to pretix.settings loading the local pretix.cfg

Not setting VITE_DEV_MODE outside CI only worked because most devs probably have set django.debug=on in their pretix.cfg
This commit is contained in:
pajowu authored and GitHub committed 2026-11-04 17:44:11 +01:00
1 parent fe0d0ceb2e
commit 4e9d60d238
1 file changed
+5 -2
+5 -2
View File
@@ -25,8 +25,10 @@ import tempfile
tmpdir = tempfile.TemporaryDirectory()
os.environ.setdefault('DATA_DIR', tmpdir.name)
if os.path.exists('test/sqlite.cfg'):
os.environ.setdefault('PRETIX_CONFIG_FILE', 'test/sqlite.cfg')
if os.path.exists('tests/ci_sqlite.cfg'):
os.environ.setdefault('PRETIX_CONFIG_FILE', 'tests/ci_sqlite.cfg')
else:
os.environ.setdefault("PRETIX_CONFIG_FILE", "")
from pretix.settings import * # NOQA
@@ -100,3 +102,4 @@ class DisableMigrations(object):
if not os.environ.get("GITHUB_WORKFLOW", ""):
MIGRATION_MODULES = DisableMigrations()
VITE_DEV_MODE = True