Skip to content

Commit 474024a

Browse files
committed
Settings tweak for testing
1 parent 2dbcac9 commit 474024a

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

settings.py

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import os
2+
import json
23

34
from django.conf import settings
45

@@ -16,7 +17,7 @@ def configure_settings():
1617

1718
if test_db is None:
1819
db_config = {
19-
'ENGINE': 'django.db.backends.postgresql_psycopg2',
20+
'ENGINE': 'django.db.backends.postgresql',
2021
'NAME': 'ambition',
2122
'USER': 'postgres',
2223
'PASSWORD': '',
@@ -27,13 +28,17 @@ def configure_settings():
2728
}
2829
elif test_db == 'postgres':
2930
db_config = {
30-
'ENGINE': 'django.db.backends.postgresql_psycopg2',
31+
'ENGINE': 'django.db.backends.postgresql',
3132
'USER': 'postgres',
3233
'NAME': 'entity',
3334
}
3435
else:
3536
raise RuntimeError('Unsupported test DB {0}'.format(test_db))
3637

38+
# Check env for db override (used for github actions)
39+
if os.environ.get('DB_SETTINGS'):
40+
db_config = json.loads(os.environ.get('DB_SETTINGS'))
41+
3742
settings.configure(
3843
ENTITY_EMAILER_MAX_SEND_MESSAGE_TRIES=3,
3944
DATABASES={

0 commit comments

Comments
 (0)