summaryrefslogtreecommitdiff
path: root/tests/shell/tests.py
diff options
context:
space:
mode:
authorhesham942 <heshamhatem2004@gmail.com>2025-03-14 15:16:38 +0200
committerNatalia <124304+nessita@users.noreply.github.com>2025-03-17 16:30:31 -0300
commit1d8696bfc6bf6af72b8452298d3e4c7bd43613c3 (patch)
tree09489243def001dab7ae1615155e181d3eb4ee2d /tests/shell/tests.py
parent181280027d998f676e82909c483f4f31e00828db (diff)
[5.2.x] Fixed #36252 -- Handled duplicate automatic imports in the shell command.
Backport of e804a07d76fc85468f27f7130ae1442fabcd650d from main.
Diffstat (limited to 'tests/shell/tests.py')
-rw-r--r--tests/shell/tests.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/shell/tests.py b/tests/shell/tests.py
index 49c85ecbe3..ff4db089f7 100644
--- a/tests/shell/tests.py
+++ b/tests/shell/tests.py
@@ -303,11 +303,16 @@ class ShellCommandAutoImportsTestCase(SimpleTestCase):
def test_message_with_stdout_listing_objects_with_isort_not_installed(self):
class TestCommand(shell.Command):
def get_auto_imports(self):
+ # Include duplicate import strings to ensure proper handling,
+ # independent of isort's deduplication (#36252).
return super().get_auto_imports() + [
"django.urls.reverse",
"django.urls.resolve",
"shell",
"django",
+ "django.urls.reverse",
+ "shell",
+ "django",
]
with captured_stdout() as stdout: