diff options
| author | François Freitag <mail@franek.fr> | 2020-04-06 12:12:41 +0200 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2020-04-07 08:45:11 +0200 |
| commit | e03eb8db9371c2af864b124701b8f970ff405ca9 (patch) | |
| tree | b970f875aef89e5ac89a6e38a711c260129940b5 /tests | |
| parent | 5fbc0e07a92f192acfa6bc4b09c3732476eeefc6 (diff) | |
Fixed #31428 -- Allowed empty message in management command self.stdout/err proxies.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/user_commands/management/commands/hal.py | 1 | ||||
| -rw-r--r-- | tests/user_commands/tests.py | 2 |
2 files changed, 2 insertions, 1 deletions
diff --git a/tests/user_commands/management/commands/hal.py b/tests/user_commands/management/commands/hal.py index 120eec961f..5791e5fae0 100644 --- a/tests/user_commands/management/commands/hal.py +++ b/tests/user_commands/management/commands/hal.py @@ -12,6 +12,7 @@ class Command(BaseCommand): app_labels = set(app_labels) if options['empty']: + self.stdout.write() self.stdout.write("Dave, I can't do that.") return diff --git a/tests/user_commands/tests.py b/tests/user_commands/tests.py index 4e730472f5..b770e8e459 100644 --- a/tests/user_commands/tests.py +++ b/tests/user_commands/tests.py @@ -124,7 +124,7 @@ class CommandTests(SimpleTestCase): def test_calling_a_command_with_only_empty_parameter_should_ends_gracefully(self): out = StringIO() management.call_command('hal', "--empty", stdout=out) - self.assertIn("Dave, I can't do that.\n", out.getvalue()) + self.assertEqual(out.getvalue(), "\nDave, I can't do that.\n") def test_calling_command_with_app_labels_and_parameters_should_be_ok(self): out = StringIO() |
