mirror of
https://github.com/django/django.git
synced 2025-10-26 23:26:08 +00:00
Refs #14661 -- Clarified the handling of initial data injected via custom SQL.
This is BACKWARDS INCOMPATIBLE CHANGE for anyone relying on SQL-injected initial data in a test case. git-svn-id: http://code.djangoproject.com/svn/django/trunk@15239 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -26,6 +26,10 @@ class Command(NoArgsCommand):
|
||||
interactive = options.get('interactive')
|
||||
show_traceback = options.get('traceback', False)
|
||||
|
||||
# Stealth option -- 'load_initial_data' is used by the testing setup
|
||||
# process to disable initial fixture loading.
|
||||
load_initial_data = options.get('load_initial_data', True)
|
||||
|
||||
self.style = no_style()
|
||||
|
||||
# Import the 'management' module within each installed app, to register
|
||||
@@ -154,5 +158,7 @@ class Command(NoArgsCommand):
|
||||
else:
|
||||
transaction.commit_unless_managed(using=db)
|
||||
|
||||
from django.core.management import call_command
|
||||
call_command('loaddata', 'initial_data', verbosity=verbosity, database=db)
|
||||
# Load initial_data fixtures (unless that has been disabled)
|
||||
if load_initial_data:
|
||||
from django.core.management import call_command
|
||||
call_command('loaddata', 'initial_data', verbosity=verbosity, database=db)
|
||||
|
||||
Reference in New Issue
Block a user