From 1c11dba835fb15d7c026d6e8a57c96ed66089437 Mon Sep 17 00:00:00 2001 From: Mariusz Felisiak Date: Fri, 22 Mar 2024 13:31:33 +0100 Subject: [PATCH] Added ModelState.from_model() test for abstract model with unnamed indexes. --- tests/migrations/test_state.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/migrations/test_state.py b/tests/migrations/test_state.py index 46dff0141709..c64e4ebb4dc1 100644 --- a/tests/migrations/test_state.py +++ b/tests/migrations/test_state.py @@ -1856,8 +1856,11 @@ class Child1(Abstract): class Child2(Abstract): pass + abstract_state = ModelState.from_model(Abstract) child1_state = ModelState.from_model(Child1) 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"]] self.assertEqual(index_names, ["migrations__name_b0afd7_idx"]) index_names = [index.name for index in child2_state.options["indexes"]]