Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stdout does not work on call_command #28

Open
erayerdin opened this issue Jul 13, 2021 · 0 comments
Open

stdout does not work on call_command #28

erayerdin opened this issue Jul 13, 2021 · 0 comments

Comments

@erayerdin
Copy link

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

  • Django 3.2.5
  • Python 3.8
  • Poetry 1.1.7
  • Pytest 6.2.4
  • Pytest Django 4.4.0
  • (if relevant) Ubuntu 20.04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant