From e767bd6838d40893b001c1ad6ba2ab9293527532 Mon Sep 17 00:00:00 2001 From: nessita <124304+nessita@users.noreply.github.com> Date: Fri, 18 Jul 2025 08:47:44 -0300 Subject: [PATCH] Refs #35680 -- Sorted shell default autoimports to prevent isort mismatches. --- django/core/management/commands/shell.py | 4 ++-- tests/shell/tests.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/django/core/management/commands/shell.py b/django/core/management/commands/shell.py index 25edc80f7c..b05e7ff404 100644 --- a/django/core/management/commands/shell.py +++ b/django/core/management/commands/shell.py @@ -133,9 +133,9 @@ class Command(BaseCommand): [ "django.conf.settings", "django.db.connection", - "django.db.reset_queries", "django.db.models", "django.db.models.functions", + "django.db.reset_queries", "django.utils.timezone", "django.contrib.sessions.models.Session", "django.contrib.contenttypes.models.ContentType", @@ -149,9 +149,9 @@ class Command(BaseCommand): default_imports = [ "django.conf.settings", "django.db.connection", - "django.db.reset_queries", "django.db.models", "django.db.models.functions", + "django.db.reset_queries", "django.utils.timezone", ] app_models_imports = default_imports + [ diff --git a/tests/shell/tests.py b/tests/shell/tests.py index 8ffbc3fa4f..78e61e6a9d 100644 --- a/tests/shell/tests.py +++ b/tests/shell/tests.py @@ -355,7 +355,7 @@ class ShellCommandAutoImportsTestCase(SimpleTestCase): " import shell\n" " import django\n" " from django.conf import settings\n" - " from django.db import connection, reset_queries, models\n" + " from django.db import connection, models, reset_queries\n" " from django.db.models import functions\n" " from django.utils import timezone\n" " from django.contrib.contenttypes.models import ContentType\n" @@ -411,7 +411,7 @@ class ShellCommandAutoImportsTestCase(SimpleTestCase): 1: "6 objects imported automatically (use -v 2 for details).", 2: "6 objects imported automatically:\n\n" " from django.conf import settings\n" - " from django.db import connection, reset_queries, models\n" + " from django.db import connection, models, reset_queries\n" " from django.db.models import functions\n" " from django.utils import timezone", }