Kaydet (Commit) d0e43f22 authored tarafından Tim Graham's avatar Tim Graham

Refs #28052 -- Cleaned up some indexes in schema tests.

üst 94128022
...@@ -1671,6 +1671,9 @@ class SchemaTests(TransactionTestCase): ...@@ -1671,6 +1671,9 @@ class SchemaTests(TransactionTestCase):
self.assertNotIn(db_index_name, new_constraints) self.assertNotIn(db_index_name, new_constraints)
# The index from Meta.indexes is still in the database. # The index from Meta.indexes is still in the database.
self.assertIn(author_index_name, new_constraints) self.assertIn(author_index_name, new_constraints)
# Drop the index
with connection.schema_editor() as editor:
editor.remove_index(AuthorWithIndexedName, index)
finally: finally:
AuthorWithIndexedName._meta.indexes = [] AuthorWithIndexedName._meta.indexes = []
...@@ -1691,6 +1694,9 @@ class SchemaTests(TransactionTestCase): ...@@ -1691,6 +1694,9 @@ class SchemaTests(TransactionTestCase):
if connection.features.uppercases_column_names: if connection.features.uppercases_column_names:
index_name = index_name.upper() index_name = index_name.upper()
self.assertIndexOrder(Author._meta.db_table, index_name, ['ASC', 'DESC']) 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): def test_indexes(self):
""" """
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment