mirror of
https://github.com/Hopiu/django-modeltranslation.git
synced 2026-05-17 09:11:06 +00:00
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:
parent
cf97b99e39
commit
6cb1009afe
2 changed files with 2 additions and 3 deletions
|
|
@ -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