summaryrefslogtreecommitdiff
path: root/tests/admin_scripts
diff options
context:
space:
mode:
authorkihuni <stephenkihuni55@gmail.com>2025-11-02 08:50:45 +0300
committerJacob Walls <jacobtylerwalls@gmail.com>2025-11-20 15:40:07 -0500
commitb1a65eac7c09250d36e12464fc8fff2a401246b6 (patch)
tree50edf2b1eca970b169d75cfdf07d6c8049f1dbff /tests/admin_scripts
parentee2e0e202874db31449d3c7c292504652fa87f69 (diff)
Fixed #36321 -- Defaulted suggest_on_error=True in management commands.
Python 3.15 defaults suggest_on_error=True, but the feature is available from 3.14, so this change opts in earlier. This change can be reverted when Python 3.15 is the minimum supported version.
Diffstat (limited to 'tests/admin_scripts')
-rw-r--r--tests/admin_scripts/tests.py16
1 files changed, 11 insertions, 5 deletions
diff --git a/tests/admin_scripts/tests.py b/tests/admin_scripts/tests.py
index 0c27194568..19ef99ac49 100644
--- a/tests/admin_scripts/tests.py
+++ b/tests/admin_scripts/tests.py
@@ -38,7 +38,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, get_docs_version
+from django.utils.version import PY313, PY314, get_docs_version
from django.views.static import serve
from . import urls
@@ -2446,10 +2446,16 @@ class Discovery(SimpleTestCase):
class CommandDBOptionChoiceTests(SimpleTestCase):
def test_invalid_choice_db_option(self):
- expected_error = (
- r"Error: argument --database: invalid choice: 'deflaut' "
- r"\(choose from '?default'?, '?other'?\)"
- )
+ if PY314:
+ expected_error = (
+ r"Error: argument --database: invalid choice: 'deflaut', "
+ r"maybe you meant 'default'\? \(choose from default, other\)"
+ )
+ else:
+ expected_error = (
+ r"Error: argument --database: invalid choice: 'deflaut' "
+ r"\(choose from '?default'?, '?other'?\)"
+ )
args = [
"changepassword",
"createsuperuser",