mirror of
				https://github.com/django/django.git
				synced 2025-10-31 09:41:08 +00:00 
			
		
		
		
	[4.1.x] Fixed #34010 -- Made parallel tests using spawn set up Django.
Bug in3b3f38b3b0. Thanks Kevin Renskers for the report. Backport of4a910f3de3from main
This commit is contained in:
		
				
					committed by
					
						 Mariusz Felisiak
						Mariusz Felisiak
					
				
			
			
				
	
			
			
			
						parent
						
							33d9247c8b
						
					
				
				
					commit
					5630a6ca29
				
			| @@ -17,6 +17,7 @@ from contextlib import contextmanager | |||||||
| from importlib import import_module | from importlib import import_module | ||||||
| from io import StringIO | from io import StringIO | ||||||
|  |  | ||||||
|  | import django | ||||||
| from django.core.management import call_command | from django.core.management import call_command | ||||||
| from django.db import connections | from django.db import connections | ||||||
| from django.test import SimpleTestCase, TestCase | from django.test import SimpleTestCase, TestCase | ||||||
| @@ -418,6 +419,7 @@ def _init_worker( | |||||||
|             if process_setup_args is None: |             if process_setup_args is None: | ||||||
|                 process_setup_args = () |                 process_setup_args = () | ||||||
|             process_setup(*process_setup_args) |             process_setup(*process_setup_args) | ||||||
|  |         django.setup() | ||||||
|         setup_test_environment() |         setup_test_environment() | ||||||
|  |  | ||||||
|     for alias in connections: |     for alias in connections: | ||||||
|   | |||||||
| @@ -27,3 +27,7 @@ Bugfixes | |||||||
| * Fixed a bug in Django 4.1 that caused :attr:`.ModelAdmin.autocomplete_fields` | * Fixed a bug in Django 4.1 that caused :attr:`.ModelAdmin.autocomplete_fields` | ||||||
|   to be incorrectly selected after adding/changing related instances via popups |   to be incorrectly selected after adding/changing related instances via popups | ||||||
|   (:ticket:`34025`). |   (: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`). | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user