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 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"); 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."