1
0
mirror of https://github.com/django/django.git synced 2025-08-21 01:09:13 +00:00

Refs #35680 -- Sorted shell default autoimports to prevent isort mismatches.

This commit is contained in:
nessita 2025-07-18 08:47:44 -03:00 committed by GitHub
parent be8c9b19ba
commit e767bd6838
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 4 deletions

View File

@ -133,9 +133,9 @@ class Command(BaseCommand):
[ [
"django.conf.settings", "django.conf.settings",
"django.db.connection", "django.db.connection",
"django.db.reset_queries",
"django.db.models", "django.db.models",
"django.db.models.functions", "django.db.models.functions",
"django.db.reset_queries",
"django.utils.timezone", "django.utils.timezone",
"django.contrib.sessions.models.Session", "django.contrib.sessions.models.Session",
"django.contrib.contenttypes.models.ContentType", "django.contrib.contenttypes.models.ContentType",
@ -149,9 +149,9 @@ class Command(BaseCommand):
default_imports = [ default_imports = [
"django.conf.settings", "django.conf.settings",
"django.db.connection", "django.db.connection",
"django.db.reset_queries",
"django.db.models", "django.db.models",
"django.db.models.functions", "django.db.models.functions",
"django.db.reset_queries",
"django.utils.timezone", "django.utils.timezone",
] ]
app_models_imports = default_imports + [ app_models_imports = default_imports + [

View File

@ -355,7 +355,7 @@ class ShellCommandAutoImportsTestCase(SimpleTestCase):
" import shell\n" " import shell\n"
" import django\n" " import django\n"
" from django.conf import settings\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.db.models import functions\n"
" from django.utils import timezone\n" " from django.utils import timezone\n"
" from django.contrib.contenttypes.models import ContentType\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).", 1: "6 objects imported automatically (use -v 2 for details).",
2: "6 objects imported automatically:\n\n" 2: "6 objects imported automatically:\n\n"
" from django.conf import settings\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.db.models import functions\n"
" from django.utils import timezone", " from django.utils import timezone",
} }