summaryrefslogtreecommitdiff
path: root/tests/user_commands/tests.py
diff options
context:
space:
mode:
authorThomas Riccardi <thomas@deepomatic.com>2020-10-08 20:41:22 +0200
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2020-10-09 12:59:00 +0200
commitf1f24539d8c86f60d1e2951a19eb3178e15d6399 (patch)
tree016b59db4abb1e7c5337ace176a21e908dc564ce /tests/user_commands/tests.py
parentb7da588e883e12b8ac3bb8a486e654e30fc1c6c8 (diff)
Fixed #32094 -- Fixed flush() calls on management command self.stdout/err proxies.
Diffstat (limited to 'tests/user_commands/tests.py')
-rw-r--r--tests/user_commands/tests.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/user_commands/tests.py b/tests/user_commands/tests.py
index e4aeca2600..eb2d38fbfb 100644
--- a/tests/user_commands/tests.py
+++ b/tests/user_commands/tests.py
@@ -341,6 +341,13 @@ class CommandTests(SimpleTestCase):
parser = BaseCommand().create_parser('prog_name', 'subcommand', epilog=epilog)
self.assertEqual(parser.epilog, epilog)
+ def test_outputwrapper_flush(self):
+ out = StringIO()
+ with mock.patch.object(out, 'flush') as mocked_flush:
+ management.call_command('outputwrapper', stdout=out)
+ self.assertIn('Working...', out.getvalue())
+ self.assertIs(mocked_flush.called, True)
+
class CommandRunTests(AdminScriptTestCase):
"""