mirror of
https://github.com/Hopiu/django-modeltranslation.git
synced 2026-05-09 13:54:44 +00:00
Merge pull request #493 from felixxm/psycopg
Used non deprecated driver and back-end for PostgreSQL.
This commit is contained in:
commit
43925c1efc
3 changed files with 3 additions and 4 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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'))
|
||||
|
|
|
|||
|
|
@ -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',
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in a new issue