Skip to content

Commit

Permalink
Merge pull request #493 from felixxm/psycopg
Browse files Browse the repository at this point in the history
Used non deprecated driver and back-end for PostgreSQL.
  • Loading branch information
last-partizan authored Feb 18, 2019
2 parents 41eb694 + 6cb1009 commit 43925c1
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions modeltranslation/tests/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -3026,8 +3026,7 @@ def test_distinct(self):
# 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'))
Expand Down
2 changes: 1 addition & 1 deletion runtests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
})
Expand Down

0 comments on commit 43925c1

Please sign in to comment.