mirror of
https://github.com/django/django.git
synced 2025-04-15 04:44:37 +00:00
[1.11.x] Refs #28052 -- Cleaned up some indexes in schema tests.
Backport of d0e43f225f59145903c72c650eeef1f80e12f9ed from master
This commit is contained in:
parent
6e89abdc49
commit
4c12b10263
@ -1670,6 +1670,9 @@ class SchemaTests(TransactionTestCase):
|
||||
self.assertNotIn(db_index_name, new_constraints)
|
||||
# The index from Meta.indexes is still in the database.
|
||||
self.assertIn(author_index_name, new_constraints)
|
||||
# Drop the index
|
||||
with connection.schema_editor() as editor:
|
||||
editor.remove_index(AuthorWithIndexedName, index)
|
||||
finally:
|
||||
AuthorWithIndexedName._meta.indexes = []
|
||||
|
||||
@ -1690,6 +1693,9 @@ class SchemaTests(TransactionTestCase):
|
||||
if connection.features.uppercases_column_names:
|
||||
index_name = index_name.upper()
|
||||
self.assertIndexOrder(Author._meta.db_table, index_name, ['ASC', 'DESC'])
|
||||
# Drop the index
|
||||
with connection.schema_editor() as editor:
|
||||
editor.remove_index(Author, index)
|
||||
|
||||
def test_indexes(self):
|
||||
"""
|
||||
|
Loading…
x
Reference in New Issue
Block a user