1
0
mirror of https://github.com/django/django.git synced 2025-10-24 14:16:09 +00:00

Refs #27236 -- Removed Meta.index_together per deprecation timeline.

This commit is contained in:
Mariusz Felisiak
2023-09-12 05:56:16 +02:00
parent 00e1879610
commit 2abf417c81
25 changed files with 41 additions and 1308 deletions

View File

@@ -3,26 +3,16 @@ from unittest import skipUnless
from django.conf import settings
from django.db import connection
from django.db.models import (
CASCADE,
CharField,
DateTimeField,
ForeignKey,
Index,
Model,
Q,
)
from django.db.models import CASCADE, ForeignKey, Index, Q
from django.db.models.functions import Lower
from django.test import (
TestCase,
TransactionTestCase,
ignore_warnings,
skipIfDBFeature,
skipUnlessDBFeature,
)
from django.test.utils import isolate_apps, override_settings
from django.test.utils import override_settings
from django.utils import timezone
from django.utils.deprecation import RemovedInDjango51Warning
from .models import Article, ArticleTranslation, IndexedArticle2
@@ -80,21 +70,6 @@ class SchemaIndexesTests(TestCase):
index_sql[0],
)
@ignore_warnings(category=RemovedInDjango51Warning)
@isolate_apps("indexes")
def test_index_together_single_list(self):
class IndexTogetherSingleList(Model):
headline = CharField(max_length=100)
pub_date = DateTimeField()
class Meta:
index_together = ["headline", "pub_date"]
index_sql = connection.schema_editor()._model_indexes_sql(
IndexTogetherSingleList
)
self.assertEqual(len(index_sql), 1)
def test_columns_list_sql(self):
index = Index(fields=["headline"], name="whitespace_idx")
editor = connection.schema_editor()