From cdd4ff67d23b80741047eaf6b180dc67a782dfbd Mon Sep 17 00:00:00 2001 From: rafrafek <23004737+rafrafek@users.noreply.github.com> Date: Sat, 12 Feb 2022 13:57:25 +0100 Subject: [PATCH] Refs #25684 -- Removed double newline from request/response output of runserver. Follow up to 0bc5cd628042bf0a44df60a93085a4f991a84dfb. --- django/core/servers/basehttp.py | 4 ++-- tests/servers/test_basehttp.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/django/core/servers/basehttp.py b/django/core/servers/basehttp.py index 440e7bc9cb..74a42966a6 100644 --- a/django/core/servers/basehttp.py +++ b/django/core/servers/basehttp.py @@ -77,7 +77,7 @@ class WSGIServer(simple_server.WSGIServer): def handle_error(self, request, client_address): if is_broken_pipe_error(): - logger.info("- Broken pipe from %s\n", client_address) + logger.info("- Broken pipe from %s", client_address) else: super().handle_error(request, client_address) @@ -166,7 +166,7 @@ class WSGIRequestHandler(simple_server.WSGIRequestHandler): extra["status_code"] = 500 logger.error( "You're accessing the development server over HTTPS, but " - "it only supports HTTP.\n", + "it only supports HTTP.", extra=extra, ) return diff --git a/tests/servers/test_basehttp.py b/tests/servers/test_basehttp.py index a6e75a9c48..a837505feb 100644 --- a/tests/servers/test_basehttp.py +++ b/tests/servers/test_basehttp.py @@ -50,7 +50,7 @@ class WSGIRequestHandlerTestCase(SimpleTestCase): with self.assertLogs("django.server", "ERROR") as cm: handler.log_message("GET %s %s", "\x16\x03", "4") - self.assertIn( + self.assertEqual( "You're accessing the development server over HTTPS, " "but it only supports HTTP.", cm.records[0].getMessage(), @@ -114,7 +114,7 @@ class WSGIServerTestCase(SimpleTestCase): """WSGIServer handles broken pipe errors.""" request = WSGIRequest(self.request_factory.get("/").environ) client_address = ("192.168.2.0", 8080) - msg = f"- Broken pipe from {client_address}\n" + msg = f"- Broken pipe from {client_address}" tests = [ BrokenPipeError, ConnectionAbortedError,