diff --git a/django/utils/version.py b/django/utils/version.py index ecd41dac89..6f8171ffe0 100644 --- a/django/utils/version.py +++ b/django/utils/version.py @@ -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): diff --git a/tests/admin_scripts/tests.py b/tests/admin_scripts/tests.py index 50e8d4a3b1..688aaa0a2f 100644 --- a/tests/admin_scripts/tests.py +++ b/tests/admin_scripts/tests.py @@ -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()