summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2017-05-01 22:18:18 -0400
committerTim Graham <timograham@gmail.com>2017-05-01 22:19:05 -0400
commitd0e43f225f59145903c72c650eeef1f80e12f9ed (patch)
treed11e7fd2bbbfa3525638cd16fcea456e4162555c
parent941280229e8cd108c2d8ead12b0dcf3ff021bf23 (diff)
Refs #28052 -- Cleaned up some indexes in schema tests.
-rw-r--r--tests/schema/tests.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/schema/tests.py b/tests/schema/tests.py
index 0bda5c990b..17a4d7c715 100644
--- a/tests/schema/tests.py
+++ b/tests/schema/tests.py
@@ -1671,6 +1671,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 = []
@@ -1691,6 +1694,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):
"""