1
0
mirror of https://github.com/django/django.git synced 2025-10-23 21:59:11 +00:00

Refs #35591 -- Removed hardcoded "stable" version in runserver warning.

This commit is contained in:
Mariusz Felisiak
2024-08-11 13:08:00 +02:00
committed by Sarah Boyce
parent f16a9a556f
commit f883bef054
4 changed files with 16 additions and 7 deletions

View File

@@ -33,7 +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.utils.version import PY313, get_docs_version
from django.views.static import serve
from . import urls
@@ -1597,11 +1597,13 @@ class ManageRunserver(SimpleTestCase):
"Starting development server at http://0.0.0.0:8000/",
self.output.getvalue(),
)
docs_version = get_docs_version()
self.assertIn(
"WARNING: This is a development server. Do not use it in a "
"production setting. Use a production WSGI or ASGI server instead."
"\nFor more information on production servers see: "
"https://docs.djangoproject.com/en/stable/howto/deployment/",
f"https://docs.djangoproject.com/en/{docs_version}/howto/"
"deployment/",
self.output.getvalue(),
)
@@ -1613,11 +1615,13 @@ class ManageRunserver(SimpleTestCase):
"Starting development server at http://127.0.0.1:14437/",
self.output.getvalue(),
)
docs_version = get_docs_version()
self.assertIn(
"WARNING: This is a development server. Do not use it in a "
"production setting. Use a production WSGI or ASGI server instead."
"\nFor more information on production servers see: "
"https://docs.djangoproject.com/en/stable/howto/deployment/",
f"https://docs.djangoproject.com/en/{docs_version}/howto/"
"deployment/",
self.output.getvalue(),
)
@@ -1630,11 +1634,13 @@ class ManageRunserver(SimpleTestCase):
"Starting development server at http://0.0.0.0:8000/",
self.output.getvalue(),
)
docs_version = get_docs_version()
self.assertNotIn(
"WARNING: This is a development server. Do not use it in a "
"production setting. Use a production WSGI or ASGI server instead."
"\nFor more information on production servers see: "
"https://docs.djangoproject.com/en/stable/howto/deployment/",
f"https://docs.djangoproject.com/en/{docs_version}/howto/"
"deployment/",
self.output.getvalue(),
)