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

Refs #27236 -- Removed usage of Meta.index_together from indexes/introspection test models.

This commit is contained in:
David Wobrock
2022-07-11 08:23:50 +02:00
committed by Mariusz Felisiak
parent 77330a089c
commit f8f16b3cd8
3 changed files with 7 additions and 13 deletions

View File

@@ -68,17 +68,13 @@ class SchemaIndexesTests(TestCase):
)
self.assertEqual(index_name, expected[connection.vendor])
def test_index_together(self):
def test_quoted_index_name(self):
editor = connection.schema_editor()
index_sql = [str(statement) for statement in editor._model_indexes_sql(Article)]
self.assertEqual(len(index_sql), 1)
# Ensure the index name is properly quoted
# Ensure the index name is properly quoted.
self.assertIn(
connection.ops.quote_name(
editor._create_index_name(
Article._meta.db_table, ["headline", "pub_date"], suffix="_idx"
)
),
connection.ops.quote_name(Article._meta.indexes[0].name),
index_sql[0],
)