From 8233144ca0c93b589b61a2ad0fb7c851f3356a3b Mon Sep 17 00:00:00 2001 From: Mariusz Felisiak Date: Mon, 8 Jul 2019 14:11:50 +0200 Subject: [PATCH] Changed django.db.models.indexes.Index imports to django.db.models.Index. --- tests/migrations/test_state.py | 4 ++-- tests/model_indexes/models.py | 6 +++--- tests/schema/tests.py | 3 +-- 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 (