Refs #32120 -- Fixed test_add_inline_fk_index_update_data for DatabaseFeatures.indexes_foreign_keys.

This test creates an index with editor.add_index() so it's present
regardless of the database's behavior. Reverted the change from
ede9fac758.
This commit is contained in:
Tim Graham 2020-11-13 00:17:13 -05:00 committed by GitHub
parent 0cbccaebeb
commit 8ed024b9b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 6 deletions

View File

@ -321,12 +321,7 @@ class SchemaTests(TransactionTestCase):
Node._meta.add_field(new_field)
editor.execute('UPDATE schema_node SET new_parent_fk_id = %s;', [parent.pk])
editor.add_index(Node, Index(fields=['new_parent_fk'], name='new_parent_inline_fk_idx'))
assertIndex = (
self.assertIn
if connection.features.indexes_foreign_keys
else self.assertNotIn
)
assertIndex('new_parent_fk_id', self.get_indexes(Node._meta.db_table))
self.assertIn('new_parent_fk_id', self.get_indexes(Node._meta.db_table))
@skipUnlessDBFeature('supports_foreign_keys')
def test_char_field_with_db_index_to_fk(self):