mirror of
https://github.com/django/django.git
synced 2025-10-26 15:16:09 +00:00
Added the possibility to pass a stdin object to a management command.
This makes testing certain features easier. Thanks to AeroNotix for the original patch.
This commit is contained in:
@@ -306,6 +306,7 @@ class BaseCommand(object):
|
||||
self.stderr = OutputWrapper(options.get('stderr', sys.stderr))
|
||||
else:
|
||||
self.stderr = OutputWrapper(options.get('stderr', sys.stderr), self.style.ERROR)
|
||||
self.stdin = options.get('stdin', sys.stdin) # Useful for testing
|
||||
|
||||
if self.can_import_settings:
|
||||
from django.conf import settings # NOQA
|
||||
|
||||
Reference in New Issue
Block a user