[1/2] settings: Add configuration for sqlite DB backend
diff mbox series

Message ID 20191201150506.91389-1-stephen@that.guru
State Accepted
Headers show
Series
  • [1/2] settings: Add configuration for sqlite DB backend
Related show

Commit Message

Stephen Finucane Dec. 1, 2019, 3:05 p.m. UTC
Signed-off-by: Stephen Finucane <stephen@that.guru>
---
 patchwork/settings/dev.py | 7 +++++++
 1 file changed, 7 insertions(+)

Patch
diff mbox series

diff --git a/patchwork/settings/dev.py b/patchwork/settings/dev.py
index e110e745..c5afe0d5 100644
--- a/patchwork/settings/dev.py
+++ b/patchwork/settings/dev.py
@@ -51,6 +51,13 @@  DATABASES = {
 if os.getenv('PW_TEST_DB_TYPE', None) == 'postgres':
     DATABASES['default']['ENGINE'] = 'django.db.backends.postgresql_psycopg2'
     DATABASES['default']['HOST'] = os.getenv('PW_TEST_DB_HOST', '')
+elif os.getenv('PW_TEST_DB_TYPE', None) == 'sqlite':
+    DATABASES['default']['ENGINE'] = 'django.db.backends.sqlite3'
+    DATABASES['default']['NAME'] = '/dev/shm/patchwork.test.db.sqlite3'
+    del DATABASES['default']['HOST']
+    del DATABASES['default']['PORT']
+    del DATABASES['default']['USER']
+    del DATABASES['default']['PASSWORD']
 
 EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'