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');
$('
A ').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."