mirror of
https://github.com/django/django.git
synced 2025-03-13 02:40:47 +00:00
Added ModelState.from_model() test for abstract model with unnamed indexes.
This commit is contained in:
parent
8dbfef4695
commit
1c11dba835
@ -1856,8 +1856,11 @@ class ModelStateTests(SimpleTestCase):
|
|||||||
class Child2(Abstract):
|
class Child2(Abstract):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
abstract_state = ModelState.from_model(Abstract)
|
||||||
child1_state = ModelState.from_model(Child1)
|
child1_state = ModelState.from_model(Child1)
|
||||||
child2_state = ModelState.from_model(Child2)
|
child2_state = ModelState.from_model(Child2)
|
||||||
|
index_names = [index.name for index in abstract_state.options["indexes"]]
|
||||||
|
self.assertEqual(index_names, ["migrations__name_ae16a4_idx"])
|
||||||
index_names = [index.name for index in child1_state.options["indexes"]]
|
index_names = [index.name for index in child1_state.options["indexes"]]
|
||||||
self.assertEqual(index_names, ["migrations__name_b0afd7_idx"])
|
self.assertEqual(index_names, ["migrations__name_b0afd7_idx"])
|
||||||
index_names = [index.name for index in child2_state.options["indexes"]]
|
index_names = [index.name for index in child2_state.options["indexes"]]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user