summaryrefslogtreecommitdiff
path: root/tests/postgres_tests
diff options
context:
space:
mode:
authorNick Pope <nick.pope@flightdataservices.com>2019-08-20 08:54:41 +0100
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2020-02-04 13:20:06 +0100
commit335c9c94acf263901fb023404408880245b0c4b4 (patch)
tree691e9683de6c9840cd0a9a097d020c499ea735db /tests/postgres_tests
parent469bf2db15597f2c87cb0f8f64132056d2467f15 (diff)
Simplified imports from django.db and django.contrib.gis.db.
Diffstat (limited to 'tests/postgres_tests')
-rw-r--r--tests/postgres_tests/test_aggregates.py3
-rw-r--r--tests/postgres_tests/test_constraints.py6
-rw-r--r--tests/postgres_tests/test_hstore.py3
-rw-r--r--tests/postgres_tests/test_indexes.py6
-rw-r--r--tests/postgres_tests/test_operations.py5
5 files changed, 9 insertions, 14 deletions
diff --git a/tests/postgres_tests/test_aggregates.py b/tests/postgres_tests/test_aggregates.py
index a1dbe4441c..c97ed8e62d 100644
--- a/tests/postgres_tests/test_aggregates.py
+++ b/tests/postgres_tests/test_aggregates.py
@@ -1,7 +1,6 @@
import json
-from django.db.models import CharField, Q
-from django.db.models.expressions import F, OuterRef, Subquery, Value
+from django.db.models import CharField, F, OuterRef, Q, Subquery, Value
from django.db.models.functions import Cast, Concat, Substr
from django.test.utils import Approximate
diff --git a/tests/postgres_tests/test_constraints.py b/tests/postgres_tests/test_constraints.py
index b22821294a..ccdd7b818d 100644
--- a/tests/postgres_tests/test_constraints.py
+++ b/tests/postgres_tests/test_constraints.py
@@ -1,10 +1,8 @@
import datetime
from unittest import mock
-from django.db import connection, transaction
-from django.db.models import F, Func, Q
-from django.db.models.constraints import CheckConstraint
-from django.db.utils import IntegrityError
+from django.db import IntegrityError, connection, transaction
+from django.db.models import CheckConstraint, F, Func, Q
from django.utils import timezone
from . import PostgreSQLTestCase
diff --git a/tests/postgres_tests/test_hstore.py b/tests/postgres_tests/test_hstore.py
index dbb1357c41..478e0e77ca 100644
--- a/tests/postgres_tests/test_hstore.py
+++ b/tests/postgres_tests/test_hstore.py
@@ -2,7 +2,8 @@ import json
from django.core import checks, exceptions, serializers
from django.db import connection
-from django.db.models.expressions import OuterRef, RawSQL, Subquery
+from django.db.models import OuterRef, Subquery
+from django.db.models.expressions import RawSQL
from django.forms import Form
from django.test.utils import CaptureQueriesContext, isolate_apps
diff --git a/tests/postgres_tests/test_indexes.py b/tests/postgres_tests/test_indexes.py
index 91cac631e2..acdf1f4771 100644
--- a/tests/postgres_tests/test_indexes.py
+++ b/tests/postgres_tests/test_indexes.py
@@ -4,11 +4,9 @@ from django.contrib.postgres.indexes import (
BloomIndex, BrinIndex, BTreeIndex, GinIndex, GistIndex, HashIndex,
SpGistIndex,
)
-from django.db import connection
-from django.db.models import CharField
+from django.db import NotSupportedError, connection
+from django.db.models import CharField, Q
from django.db.models.functions import Length
-from django.db.models.query_utils import Q
-from django.db.utils import NotSupportedError
from django.test import skipUnlessDBFeature
from django.test.utils import register_lookup
diff --git a/tests/postgres_tests/test_operations.py b/tests/postgres_tests/test_operations.py
index 7be6de9eff..95c88d5fe0 100644
--- a/tests/postgres_tests/test_operations.py
+++ b/tests/postgres_tests/test_operations.py
@@ -2,9 +2,8 @@ import unittest
from migrations.test_base import OperationTestBase
-from django.db import connection, models
+from django.db import NotSupportedError, connection
from django.db.models import Index
-from django.db.utils import NotSupportedError
from django.test import modify_settings
try:
@@ -26,7 +25,7 @@ class AddIndexConcurrentlyTests(OperationTestBase):
new_state = project_state.clone()
operation = AddIndexConcurrently(
'Pony',
- models.Index(fields=['pink'], name='pony_pink_idx'),
+ Index(fields=['pink'], name='pony_pink_idx'),
)
msg = (
'The AddIndexConcurrently operation cannot be executed inside '