1
0
mirror of https://github.com/django/django.git synced 2025-10-24 22:26:08 +00:00

Fixed #7497 -- Allowed overriding the order of apps and models in admin.

This commit is contained in:
adontz
2022-03-05 20:09:42 +04:00
committed by Mariusz Felisiak
parent d44951b36e
commit 2bee0b4328
5 changed files with 63 additions and 10 deletions

View File

@@ -1358,6 +1358,17 @@ class AdminViewBasicTest(AdminViewBasicTestCase):
models = [model["name"] for model in response.context["app_list"][0]["models"]]
self.assertSequenceEqual(models, sorted(models))
def test_app_index_context_reordered(self):
self.client.force_login(self.superuser)
response = self.client.get(reverse("admin2:app_list", args=("admin_views",)))
self.assertContains(
response,
"<title>Admin_Views administration | Django site admin</title>",
)
# Models are in reverse order.
models = [model["name"] for model in response.context["app_list"][0]["models"]]
self.assertSequenceEqual(models, sorted(models, reverse=True))
def test_change_view_subtitle_per_object(self):
response = self.client.get(
reverse("admin:admin_views_article_change", args=(self.a1.pk,)),