소스 검색

Fixed #34010 -- Made parallel tests using spawn set up Django.

Bug in 3b3f38b3b09b0f2373e51406ecb8c9c45d36aebc.

Thanks Kevin Renskers for the report.
Adam Johnson 2 년 전
부모
커밋
4a910f3de3
2개의 변경된 파일6개의 추가작업 그리고 0개의 파일을 삭제
  1. 2 0
      django/test/runner.py
  2. 4 0
      docs/releases/4.1.2.txt

+ 2 - 0
django/test/runner.py

@@ -17,6 +17,7 @@ from contextlib import contextmanager
 from importlib import import_module
 from io import StringIO
 
+import django
 from django.core.management import call_command
 from django.db import connections
 from django.test import SimpleTestCase, TestCase
@@ -418,6 +419,7 @@ def _init_worker(
             if process_setup_args is None:
                 process_setup_args = ()
             process_setup(*process_setup_args)
+        django.setup()
         setup_test_environment()
 
     for alias in connections:

+ 4 - 0
docs/releases/4.1.2.txt

@@ -27,3 +27,7 @@ Bugfixes
 * Fixed a bug in Django 4.1 that caused :attr:`.ModelAdmin.autocomplete_fields`
   to be incorrectly selected after adding/changing related instances via popups
   (:ticket:`34025`).
+
+* Fixed a regression in Django 4.1 where the app registry was not populated
+  when running parallel tests with the ``multiprocessing`` start method
+  ``spawn`` (:ticket:`34010`).