summaryrefslogtreecommitdiff
path: root/tests/admin_views/customadmin.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/admin_views/customadmin.py')
-rw-r--r--tests/admin_views/customadmin.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/admin_views/customadmin.py b/tests/admin_views/customadmin.py
index f9e1f6fe1a..e3429ec4bc 100644
--- a/tests/admin_views/customadmin.py
+++ b/tests/admin_views/customadmin.py
@@ -35,6 +35,14 @@ class Admin2(admin.AdminSite):
def password_change(self, request, extra_context=None):
return super().password_change(request, {"spam": "eggs"})
+ def get_app_list(self, request, app_label=None):
+ app_list = super().get_app_list(request, app_label=app_label)
+ # Reverse order of apps and models.
+ app_list = list(reversed(app_list))
+ for app in app_list:
+ app["models"].sort(key=lambda x: x["name"], reverse=True)
+ return app_list
+
class UserLimitedAdmin(UserAdmin):
# used for testing password change on a user not in queryset