summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorClaude Paroz <claude@2xlibre.net>2014-12-18 21:17:17 +0100
committerClaude Paroz <claude@2xlibre.net>2014-12-18 21:17:17 +0100
commit5b1fb0a75d6961d78ba68c72008f1cc535f9689a (patch)
tree89b039ddcf5df94dd318cfa4051d1dc7bcbb87f2 /tests
parent0c06f06131c613dc4173c83ea17c68c31835fc71 (diff)
Forward-ported test and release note from f46a16614
Refs #24015.
Diffstat (limited to 'tests')
-rw-r--r--tests/indexes/tests.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/tests/indexes/tests.py b/tests/indexes/tests.py
index 411b7646c4..1ba9f1f044 100644
--- a/tests/indexes/tests.py
+++ b/tests/indexes/tests.py
@@ -12,8 +12,16 @@ class CreationIndexesTests(TestCase):
Test index handling by the to-be-deprecated connection.creation interface.
"""
def test_index_together(self):
- index_sql = connection.creation.sql_indexes_for_model(Article, no_style())
+ editor = connection.schema_editor()
+ index_sql = editor._model_indexes_sql(Article)
self.assertEqual(len(index_sql), 1)
+ # Ensure the index name is properly quoted
+ self.assertIn(
+ connection.ops.quote_name(
+ editor._create_index_name(Article, ['headline', 'pub_date'], suffix='_idx')
+ ),
+ index_sql[0]
+ )
def test_index_together_single_list(self):
# Test for using index_together with a single list (#22172)