mirror of
https://github.com/django/django.git
synced 2024-12-22 17:16:24 +00:00
Refs #34900 -- Fixed CommandTypes.test_help_default_options_with_custom_arguments test on Python 3.13+.
c4a2e8a2c5
This commit is contained in:
parent
e626716c28
commit
3426a5c33c
@ -20,6 +20,7 @@ PY39 = sys.version_info >= (3, 9)
|
||||
PY310 = sys.version_info >= (3, 10)
|
||||
PY311 = sys.version_info >= (3, 11)
|
||||
PY312 = sys.version_info >= (3, 12)
|
||||
PY313 = sys.version_info >= (3, 13)
|
||||
|
||||
|
||||
def get_version(version=None):
|
||||
|
@ -33,6 +33,7 @@ from django.db.migrations.recorder import MigrationRecorder
|
||||
from django.test import LiveServerTestCase, SimpleTestCase, TestCase, override_settings
|
||||
from django.test.utils import captured_stderr, captured_stdout
|
||||
from django.urls import path
|
||||
from django.utils.version import PY313
|
||||
from django.views.static import serve
|
||||
|
||||
from . import urls
|
||||
@ -1901,10 +1902,16 @@ class CommandTypes(AdminScriptTestCase):
|
||||
]
|
||||
for option in expected_options:
|
||||
self.assertOutput(out, f"[{option}]")
|
||||
self.assertOutput(out, "--option_a OPTION_A, -a OPTION_A")
|
||||
self.assertOutput(out, "--option_b OPTION_B, -b OPTION_B")
|
||||
self.assertOutput(out, "--option_c OPTION_C, -c OPTION_C")
|
||||
self.assertOutput(out, "-v {0,1,2,3}, --verbosity {0,1,2,3}")
|
||||
if PY313:
|
||||
self.assertOutput(out, "--option_a, -a OPTION_A")
|
||||
self.assertOutput(out, "--option_b, -b OPTION_B")
|
||||
self.assertOutput(out, "--option_c, -c OPTION_C")
|
||||
self.assertOutput(out, "-v, --verbosity {0,1,2,3}")
|
||||
else:
|
||||
self.assertOutput(out, "--option_a OPTION_A, -a OPTION_A")
|
||||
self.assertOutput(out, "--option_b OPTION_B, -b OPTION_B")
|
||||
self.assertOutput(out, "--option_c OPTION_C, -c OPTION_C")
|
||||
self.assertOutput(out, "-v {0,1,2,3}, --verbosity {0,1,2,3}")
|
||||
|
||||
def test_color_style(self):
|
||||
style = color.no_style()
|
||||
|
Loading…
Reference in New Issue
Block a user