mirror of
https://github.com/django/django.git
synced 2025-08-03 18:38:50 +00:00
Fixed #23107 -- Made runserver output respect --no-color.
This commit reverts 67d7da5fb9
.
The previous fix changed the environment globally, which meant
that any call to `call_command(no_color=True)` prevented further
`call_command` with color.
This fix still relies on the environment because it's currently the only
way to reach WSGIRequestHandler, but it's now limited to the `runserver`
command. This seems an acceptable compromise considering `runserver` runs
indefinitely.
Thanks Tim Graham for the review.
This commit is contained in:
parent
9f1202c166
commit
c34e13e17c
3 changed files with 8 additions and 2 deletions
|
@ -1397,7 +1397,6 @@ class CommandTypes(AdminScriptTestCase):
|
|||
out = StringIO()
|
||||
|
||||
call_command('color_command', no_color=True, stdout=out)
|
||||
self.assertEqual(os.environ.get('DJANGO_COLORS', ''), 'nocolor')
|
||||
self.assertEqual(out.getvalue(), 'BEGIN\n')
|
||||
|
||||
def test_base_command(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue