summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMariusz Felisiak <felisiak.mariusz@gmail.com>2019-07-08 14:11:50 +0200
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2019-07-08 14:19:46 +0200
commit8233144ca0c93b589b61a2ad0fb7c851f3356a3b (patch)
treefcc89eb318a917c2816eff5809ef60b91b362ba5 /tests
parentbc91f27a86090b4c688b56cd4e37f95eebe6e969 (diff)
downloaddjango-8233144ca0c93b589b61a2ad0fb7c851f3356a3b.tar.gz
Changed django.db.models.indexes.Index imports to django.db.models.Index.
Diffstat (limited to 'tests')
-rw-r--r--tests/migrations/test_state.py4
-rw-r--r--tests/model_indexes/models.py6
-rw-r--r--tests/schema/tests.py3
3 files changed, 6 insertions, 7 deletions
diff --git a/tests/migrations/test_state.py b/tests/migrations/test_state.py
index 259a42f7fd..0f0f918597 100644
--- a/tests/migrations/test_state.py
+++ b/tests/migrations/test_state.py
@@ -1105,7 +1105,7 @@ class ModelStateTests(SimpleTestCase):
class Meta:
app_label = 'migrations'
abstract = True
- indexes = [models.indexes.Index(fields=['name'])]
+ indexes = [models.Index(fields=['name'])]
class Child1(Abstract):
pass
@@ -1131,7 +1131,7 @@ class ModelStateTests(SimpleTestCase):
class Meta:
app_label = 'migrations'
- indexes = [models.indexes.Index(fields=['name'], name='foo_idx')]
+ indexes = [models.Index(fields=['name'], name='foo_idx')]
model_state = ModelState.from_model(TestModel)
index_names = [index.name for index in model_state.options['indexes']]
diff --git a/tests/model_indexes/models.py b/tests/model_indexes/models.py
index fbee67a152..6f7548261f 100644
--- a/tests/model_indexes/models.py
+++ b/tests/model_indexes/models.py
@@ -10,8 +10,8 @@ class Book(models.Model):
class Meta:
indexes = [
- models.indexes.Index(fields=['title']),
- models.indexes.Index(fields=['isbn', 'id']),
+ models.Index(fields=['title']),
+ models.Index(fields=['isbn', 'id']),
]
@@ -20,7 +20,7 @@ class AbstractModel(models.Model):
class Meta:
abstract = True
- indexes = [models.indexes.Index(fields=['name'])]
+ indexes = [models.Index(fields=['name'])]
class ChildModel1(AbstractModel):
diff --git a/tests/schema/tests.py b/tests/schema/tests.py
index 64a1512a53..91760987d7 100644
--- a/tests/schema/tests.py
+++ b/tests/schema/tests.py
@@ -8,7 +8,7 @@ from django.core.management.color import no_style
from django.db import (
DatabaseError, IntegrityError, OperationalError, connection,
)
-from django.db.models import Model, Q
+from django.db.models import Index, Model, Q
from django.db.models.constraints import CheckConstraint, UniqueConstraint
from django.db.models.deletion import CASCADE, PROTECT
from django.db.models.fields import (
@@ -19,7 +19,6 @@ from django.db.models.fields import (
from django.db.models.fields.related import (
ForeignKey, ForeignObject, ManyToManyField, OneToOneField,
)
-from django.db.models.indexes import Index
from django.db.transaction import TransactionManagementError, atomic
from django.db.utils import DataError
from django.test import (