mirror of
https://github.com/django/django.git
synced 2025-03-12 02:12:38 +00:00
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 ede9fac75807fe5810df66280a60e7068cc97e4a.
This commit is contained in:
parent
0cbccaebeb
commit
8ed024b9b9
@ -321,12 +321,7 @@ class SchemaTests(TransactionTestCase):
|
|||||||
Node._meta.add_field(new_field)
|
Node._meta.add_field(new_field)
|
||||||
editor.execute('UPDATE schema_node SET new_parent_fk_id = %s;', [parent.pk])
|
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'))
|
editor.add_index(Node, Index(fields=['new_parent_fk'], name='new_parent_inline_fk_idx'))
|
||||||
assertIndex = (
|
self.assertIn('new_parent_fk_id', self.get_indexes(Node._meta.db_table))
|
||||||
self.assertIn
|
|
||||||
if connection.features.indexes_foreign_keys
|
|
||||||
else self.assertNotIn
|
|
||||||
)
|
|
||||||
assertIndex('new_parent_fk_id', self.get_indexes(Node._meta.db_table))
|
|
||||||
|
|
||||||
@skipUnlessDBFeature('supports_foreign_keys')
|
@skipUnlessDBFeature('supports_foreign_keys')
|
||||||
def test_char_field_with_db_index_to_fk(self):
|
def test_char_field_with_db_index_to_fk(self):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user