From 6821a7c9904861bf1381383b95ed85ff49d9ee5d Mon Sep 17 00:00:00 2001 From: Dani Fornons Date: Mon, 10 Nov 2025 10:21:46 +0100 Subject: [PATCH 1/3] Fixed #36053 -- Fixed placement of FilteredSelectMultiple widget label. --- django/contrib/admin/static/admin/js/SelectFilter2.js | 5 ++--- js_tests/admin/SelectFilter2.test.js | 7 +++++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/django/contrib/admin/static/admin/js/SelectFilter2.js b/django/contrib/admin/static/admin/js/SelectFilter2.js index 2100280220af..fde59d30293f 100644 --- a/django/contrib/admin/static/admin/js/SelectFilter2.js +++ b/django/contrib/admin/static/admin/js/SelectFilter2.js @@ -32,9 +32,8 @@ Requires core.js and SelectBox.js. //
or
const selector_div = quickElement('div', from_box.parentNode); - // Make sure the selector div is at the beginning so that the - // add link would be displayed to the right of the widget. - from_box.parentNode.prepend(selector_div); + // Make sure the selector div appears between the label and the add link. + from_box.parentNode.insertBefore(selector_div, from_box.nextSibling); selector_div.className = is_stacked ? 'selector stacked' : 'selector'; //
diff --git a/js_tests/admin/SelectFilter2.test.js b/js_tests/admin/SelectFilter2.test.js index 533c24811c05..9a020d2c539a 100644 --- a/js_tests/admin/SelectFilter2.test.js +++ b/js_tests/admin/SelectFilter2.test.js @@ -10,8 +10,11 @@ QUnit.test('init', function(assert) { $('
This is helpful.
').appendTo('#test'); $('').appendTo('#test'); SelectFilter.init('id', 'things', 0); - assert.equal($('#test').children().first().prop("tagName"), "DIV"); - assert.equal($('#test').children().first().attr("class"), "selector"); + assert.deepEqual( + Array.from($('#test')[0].children).map(child => child.tagName), + ["LABEL", "DIV", "DIV"] + ); + assert.equal($('.helptext')[0].nextSibling.getAttribute("class"), "selector"); assert.equal($('.selector-available label').text().trim(), "Available things"); assert.equal($('.selector-available label').attr("id"), "id_from_label"); assert.equal($('.selector-chosen label').text().trim(), "Chosen things"); From c60a708b58d6c8725f2e9dc46ac43d38250989b8 Mon Sep 17 00:00:00 2001 From: Jacob Walls Date: Tue, 11 Nov 2025 16:36:49 -0500 Subject: [PATCH 2/3] Refs #35844 -- Checked for forkserver mode when running runtests.py with --selenium and --parallel. --- tests/runtests.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/runtests.py b/tests/runtests.py index ccfc3279ff6e..974ec257d51c 100755 --- a/tests/runtests.py +++ b/tests/runtests.py @@ -746,7 +746,10 @@ def paired_tests(paired_test, options, test_labels, start_at, start_after): options.settings = os.environ["DJANGO_SETTINGS_MODULE"] if options.selenium: - if multiprocessing.get_start_method() == "spawn" and options.parallel != 1: + if ( + multiprocessing.get_start_method() in {"spawn", "forkserver"} + and options.parallel != 1 + ): parser.error( "You cannot use --selenium with parallel tests on this system. " "Pass --parallel=1 to use --selenium." From c0d7fbe5021b0d2aaa5bb1196a6b43afcecec4d0 Mon Sep 17 00:00:00 2001 From: Jacob Walls Date: Tue, 11 Nov 2025 16:44:04 -0500 Subject: [PATCH 3/3] Refs #35844 -- Ran selenium tests with --parallel=1. --- .github/workflows/screenshots.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/screenshots.yml b/.github/workflows/screenshots.yml index 239b6958d857..1a835fe1a660 100644 --- a/.github/workflows/screenshots.yml +++ b/.github/workflows/screenshots.yml @@ -33,7 +33,7 @@ jobs: - name: Run Selenium tests with screenshots working-directory: ./tests/ - run: python -Wall runtests.py --verbosity=2 --noinput --selenium=chrome --headless --screenshots --settings=test_sqlite --parallel=2 + run: python -Wall runtests.py --verbosity=2 --noinput --selenium=chrome --headless --screenshots --settings=test_sqlite --parallel=1 - name: Cache oxipng uses: actions/cache@v4