Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed #33082 -- Fixed CommandTests.test_subparser_invalid_option on Python 3.9.7+. #14826

Merged
merged 1 commit into from Sep 2, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 1 addition & 4 deletions tests/user_commands/tests.py
Expand Up @@ -17,7 +17,6 @@
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

Expand Down Expand Up @@ -334,9 +333,7 @@ def test_subparser_dest_required_args(self):
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'
Expand Down