Skip to content

Commit d44951b

Browse files
committed
Refs #7497 -- Added assertion for the default order of models in AdminSite.app_index().
1 parent 1d9d082 commit d44951b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

tests/admin_views/tests.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1354,6 +1354,9 @@ def test_app_index_context(self):
13541354
)
13551355
self.assertEqual(response.context["title"], "Admin_Views administration")
13561356
self.assertEqual(response.context["app_label"], "admin_views")
1357+
# Models are sorted alphabetically by default.
1358+
models = [model["name"] for model in response.context["app_list"][0]["models"]]
1359+
self.assertSequenceEqual(models, sorted(models))
13571360

13581361
def test_change_view_subtitle_per_object(self):
13591362
response = self.client.get(

0 commit comments

Comments
 (0)