summaryrefslogtreecommitdiff
path: root/tests/admin_scripts
diff options
context:
space:
mode:
authorMariusz Felisiak <felisiak.mariusz@gmail.com>2024-02-20 20:59:26 +0100
committerGitHub <noreply@github.com>2024-02-20 20:59:26 +0100
commit3426a5c33c36266af42128ee9eca4921e68ea876 (patch)
treef7558512960dc12b9e29bb2044b64afe677de69f /tests/admin_scripts
parente626716c28b6286f8cf0f8174077f3d2244f3eb3 (diff)
Refs #34900 -- Fixed CommandTypes.test_help_default_options_with_custom_arguments test on Python 3.13+.
https://github.com/python/cpython/commit/c4a2e8a2c5188c3288d57b80852e92c83f46f6f3
Diffstat (limited to 'tests/admin_scripts')
-rw-r--r--tests/admin_scripts/tests.py15
1 files changed, 11 insertions, 4 deletions
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()