mirror of
				https://github.com/django/django.git
				synced 2025-10-31 09:41:08 +00:00 
			
		
		
		
	[1.9.x] Fixed #23372 -- Made loaddata faster if it doesn't find any fixtures.
Django's test suite often tries to load fixture files from apps that have
no fixtures at all. This creates a lot of unnecessary disabling and
enabling of constraints which can be expensive on some database.
To speed this up, loaddata now first checks if any fixture file matches.
If no fixture file is matched, then the command exits before disabling
and enabling of constraints is done.
The main benefit of this change is seen on MSSQL, where tests on
Django 1.8 run hours faster.
Backport of ee9f4686b1 from master
			
			
This commit is contained in:
		
				
					committed by
					
						 Tim Graham
						Tim Graham
					
				
			
			
				
	
			
			
			
						parent
						
							b37cb0b958
						
					
				
				
					commit
					99569b22d9
				
			| @@ -51,3 +51,6 @@ Bugfixes | ||||
|  | ||||
| * Fixed a regression in the admin which ignored line breaks in read-only fields | ||||
|   instead of converting them to ``<br>`` (:ticket:`25465`). | ||||
|  | ||||
| * Made ``loaddata`` skip disabling and enabling database constraints when it | ||||
|   doesn't load any fixtures (:ticket:`23372`). | ||||
|   | ||||
| @@ -73,3 +73,6 @@ Bugfixes | ||||
|  | ||||
| * Fixed incorrect object reference in | ||||
|   ``SingleObjectMixin.get_context_object_name()`` (:ticket:`26006`). | ||||
|  | ||||
| * Made ``loaddata`` skip disabling and enabling database constraints when it | ||||
|   doesn't load any fixtures (:ticket:`23372`). | ||||
|   | ||||
		Reference in New Issue
	
	Block a user