Loading django/core/management/base.py +1 −0 Original line number Diff line number Diff line Loading @@ -380,6 +380,7 @@ class BaseCommand(object): if options.get('no_color'): self.style = no_style() self.stderr = OutputWrapper(options.get('stderr', sys.stderr)) os.environ["DJANGO_COLORS"] = "nocolor" else: self.stderr = OutputWrapper(options.get('stderr', sys.stderr), self.style.ERROR) Loading tests/admin_scripts/tests.py +1 −0 Original line number Diff line number Diff line Loading @@ -1385,6 +1385,7 @@ 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 Loading
django/core/management/base.py +1 −0 Original line number Diff line number Diff line Loading @@ -380,6 +380,7 @@ class BaseCommand(object): if options.get('no_color'): self.style = no_style() self.stderr = OutputWrapper(options.get('stderr', sys.stderr)) os.environ["DJANGO_COLORS"] = "nocolor" else: self.stderr = OutputWrapper(options.get('stderr', sys.stderr), self.style.ERROR) Loading
tests/admin_scripts/tests.py +1 −0 Original line number Diff line number Diff line Loading @@ -1385,6 +1385,7 @@ 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