mirror of
https://github.com/django/django.git
synced 2025-08-04 10:59:45 +00:00
Fixed #25175 -- Renamed the postgresql_psycopg2 database backend to postgresql.
This commit is contained in:
parent
8656cfc4e0
commit
ec9004728e
25 changed files with 42 additions and 25 deletions
|
@ -9,7 +9,7 @@ class TestLoadBackend(SimpleTestCase):
|
|||
msg = (
|
||||
"'foo' isn't an available database backend.\n"
|
||||
"Try using 'django.db.backends.XXX', where XXX is one of:\n"
|
||||
" 'mysql', 'oracle', 'postgresql_psycopg2', 'sqlite3'\n"
|
||||
" 'mysql', 'oracle', 'postgresql', 'sqlite3'\n"
|
||||
"Error was: No module named %s"
|
||||
) % "foo.base" if six.PY2 else "'foo'"
|
||||
with self.assertRaisesMessage(ImproperlyConfigured, msg):
|
||||
|
|
|
@ -18,7 +18,7 @@ from django.db import (
|
|||
reset_queries, transaction,
|
||||
)
|
||||
from django.db.backends.base.base import BaseDatabaseWrapper
|
||||
from django.db.backends.postgresql_psycopg2 import version as pg_version
|
||||
from django.db.backends.postgresql import version as pg_version
|
||||
from django.db.backends.signals import connection_created
|
||||
from django.db.backends.utils import CursorWrapper, format_number
|
||||
from django.db.models import Avg, StdDev, Sum, Variance
|
||||
|
@ -313,7 +313,7 @@ class PostgreSQLTests(TestCase):
|
|||
self.assertEqual(a[0], b[0])
|
||||
|
||||
def test_lookup_cast(self):
|
||||
from django.db.backends.postgresql_psycopg2.operations import DatabaseOperations
|
||||
from django.db.backends.postgresql.operations import DatabaseOperations
|
||||
|
||||
do = DatabaseOperations(connection=None)
|
||||
for lookup in ('iexact', 'contains', 'icontains', 'startswith',
|
||||
|
@ -321,8 +321,8 @@ class PostgreSQLTests(TestCase):
|
|||
self.assertIn('::text', do.lookup_cast(lookup))
|
||||
|
||||
def test_correct_extraction_psycopg2_version(self):
|
||||
from django.db.backends.postgresql_psycopg2.base import psycopg2_version
|
||||
version_path = 'django.db.backends.postgresql_psycopg2.base.Database.__version__'
|
||||
from django.db.backends.postgresql.base import psycopg2_version
|
||||
version_path = 'django.db.backends.postgresql.base.Database.__version__'
|
||||
|
||||
with mock.patch(version_path, '2.6.9'):
|
||||
self.assertEqual(psycopg2_version(), (2, 6, 9))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue