Fixed #25204 -- Added missing space in runserver logging.

This commit is contained in:
Tim Graham 2015-07-31 12:45:27 -04:00
parent f93e7f5674
commit 1a76257b1b
2 changed files with 11 additions and 1 deletions

View File

@ -104,7 +104,7 @@ class WSGIRequestHandler(simple_server.WSGIRequestHandler, object):
def log_message(self, format, *args):
msg = "[%s]" % self.log_date_time_string()
msg = "[%s] " % self.log_date_time_string()
try:
msg += "%s\n" % (format % args)
except UnicodeDecodeError:

View File

@ -13,6 +13,16 @@ class Stub(object):
class WSGIRequestHandlerTestCase(SimpleTestCase):
def test_log_message(self):
request = WSGIRequest(RequestFactory().get('/').environ)
request.makefile = lambda *args, **kwargs: BytesIO()
handler = WSGIRequestHandler(request, '192.168.0.2', None)
with captured_stderr() as stderr:
handler.log_message('GET %s %s', 'A', 'B')
self.assertIn('] GET A B', stderr.getvalue())
def test_https(self):
request = WSGIRequest(RequestFactory().get('/').environ)
request.makefile = lambda *args, **kwargs: BytesIO()