Used postgresql back-end instead of deprecated django.db.backends.postgresql_psycopg2.

django.db.backends.postgresql_psycopg2 has been removed in Django 3.0.
This commit is contained in:
Mariusz Felisiak 2019-02-18 12:13:17 +01:00
parent cf97b99e39
commit 6cb1009afe
No known key found for this signature in database
GPG key ID: 2EF56372BA48CD1B
2 changed files with 2 additions and 3 deletions

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',
})