diff options
author | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2021-09-02 10:56:56 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-02 10:56:56 +0200 |
commit | 50ed545e2fa02c51e0d1559b83624f256e4b499b (patch) | |
tree | 54cf54f04ce96a97ca1905fd7a73a432746f8b2a /tests/user_commands | |
parent | d0ea01af2814e276c4a090e599d5fd11c6ce4bf8 (diff) | |
download | django-50ed545e2fa02c51e0d1559b83624f256e4b499b.tar.gz |
Fixed #33082 -- Fixed CommandTests.test_subparser_invalid_option on Python 3.9.7+.
Thanks Michał Górny for the report.
Diffstat (limited to 'tests/user_commands')
-rw-r--r-- | tests/user_commands/tests.py | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/tests/user_commands/tests.py b/tests/user_commands/tests.py index 2e5589647a..60cfe86b3d 100644 --- a/tests/user_commands/tests.py +++ b/tests/user_commands/tests.py @@ -17,7 +17,6 @@ from django.test import SimpleTestCase, override_settings from django.test.utils import captured_stderr, extend_sys_path, ignore_warnings from django.utils import translation from django.utils.deprecation import RemovedInDjango41Warning -from django.utils.version import PY310 from .management.commands import dance @@ -334,9 +333,7 @@ class CommandTests(SimpleTestCase): self.assertIn('bar', out.getvalue()) def test_subparser_invalid_option(self): - msg = "Error:%s invalid choice: 'test' (choose from 'foo')" % ( - ' argument {foo}:' if PY310 else '' - ) + msg = "invalid choice: 'test' (choose from 'foo')" with self.assertRaisesMessage(CommandError, msg): management.call_command('subparser', 'test', 12) msg = 'Error: the following arguments are required: subcommand' |