GaretJax / django-click

Write Django management command using the click CLI library
MIT License
251 stars 20 forks source link

stdout does not work on `call_command` #28

Open erayerdin opened 3 years ago

erayerdin commented 3 years ago

Assuming we have a command named foo...

import io

buffer = io.StringIO()
from django.core.management import call_command
call_command("foo", stdout=buffer)
out = buffer.getvalue()
assert "whatever" in out

This is not possible with django-click, instead saying:

TypeError: Unknown option(s) for dumb command: stdout. Valid options are: color, h, help, pythonpath, settings, traceback, v, verbosity, version.

Environment