[2/3] Default dev settings, set host to empty (unix socket) on postgresql

Message ID 20180703063751.12068-2-daniel@linux.ibm.com
State Superseded
Headers show
Series
  • [1/3] travis: test against postgresql 10
Related show

Commit Message

Daniel Black July 3, 2018, 6:37 a.m.
An empty environment variable resulted in localhost, meaning
posgresql connecting to domain sockets wasn't available.

Signed-off-by: Daniel Black <daniel@linux.ibm.com>
---
 .travis.yml               | 2 ++
 patchwork/settings/dev.py | 1 +
 2 files changed, 3 insertions(+)

Patch

diff --git a/.travis.yml b/.travis.yml
index d61b255..6576f07 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -22,6 +22,7 @@  env:
     - PW_TEST_DB_TYPE=mysql PW_TEST_DB_USER=root
   global:
     - PW_TEST_DB_PASS=""
+    - PW_TEST_DB_HOST="localhost"
 
 matrix:
   include:
@@ -33,6 +34,7 @@  matrix:
           - postgresql-client-10
       env:
         - PGPORT=5433
+        - PW_TEST_DB_HOST=""
         - PW_TEST_DB_PORT=5433
         - PW_TEST_DB_TYPE=postgres
         - PW_TEST_DB_USER=travis
diff --git a/patchwork/settings/dev.py b/patchwork/settings/dev.py
index 7bdfdff..0f79b61 100644
--- a/patchwork/settings/dev.py
+++ b/patchwork/settings/dev.py
@@ -41,6 +41,7 @@  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', '')
 
 EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'