mirror of
https://github.com/django/django.git
synced 2025-08-03 10:34:04 +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:
parent
3c547a423f
commit
116d39842d
2 changed files with 28 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue