Merge pull request #493 from felixxm/psycopg

Used non deprecated driver and back-end for PostgreSQL.
This commit is contained in:
partizan 2019-02-18 13:34:57 +02:00 committed by GitHub
commit 43925c1efc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 4 deletions

View file

@ -40,7 +40,7 @@ before_script:
- psql -c 'create database modeltranslation;' -U postgres
install:
- if [[ $DB == mysql ]]; then pip install -q mysqlclient; fi
- if [[ $DB == postgres ]]; then pip install -q psycopg2; fi
- if [[ $DB == postgres ]]; then pip install -q psycopg2-binary; fi
- pip install -q Pillow
- IDJANGO=$(./travis.py $DJANGO)
- pip install -q $IDJANGO

View file

@ -3026,8 +3026,7 @@ class TestManager(ModeltranslationTestBase):
# the distinct applies to (this generates a DISTINCT ON (*fields) sql expression).
# NB: DISTINCT ON expressions must be accompanied by an order_by() that starts with the
# same fields in the same order
if (django_settings.DATABASES['default']['ENGINE'] ==
'django.db.backends.postgresql_psycopg2'):
if django_settings.DATABASES['default']['ENGINE'] == 'django.db.backends.postgresql':
titles_for_en = tuple(
(m.title, m.description) for m in manager.order_by(
'title', 'description').distinct('title'))

View file

@ -27,7 +27,7 @@ def runtests(test_path='modeltranslation'):
})
elif test_db == 'postgres':
DATABASES['default'].update({
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'ENGINE': 'django.db.backends.postgresql',
'USER': 'postgres',
'NAME': 'modeltranslation',
})