Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/screenshots.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 2 additions & 3 deletions django/contrib/admin/static/admin/js/SelectFilter2.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,8 @@ Requires core.js and SelectBox.js.

// <div class="selector"> or <div class="selector stacked">
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';

// <div class="selector-available">
Expand Down
7 changes: 5 additions & 2 deletions js_tests/admin/SelectFilter2.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,11 @@ QUnit.test('init', function(assert) {
$('<div class="helptext">This is helpful.</div>').appendTo('#test');
$('<select id="id"><option value="0">A</option></select>').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");
Expand Down
5 changes: 4 additions & 1 deletion tests/runtests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down