summaryrefslogtreecommitdiff
path: root/tests/wsgi
diff options
context:
space:
mode:
authorPiotr Domanski <piotrjerzydomanski@gmail.com>2019-07-24 19:06:01 +0200
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2019-07-26 07:31:51 +0200
commit4b4e68a7a6847e8b449923bb882bed01f0d7b2a8 (patch)
treefc746fd29f3cdb19dcab18e0dc563c73f0c05531 /tests/wsgi
parent806ba19bbff311b7d567857ae61db6ff84af4a2c (diff)
downloaddjango-4b4e68a7a6847e8b449923bb882bed01f0d7b2a8.tar.gz
Fixed #30567 -- Made WSGIHandler pass FileResponse.block_size to wsgi.file_wrapper.
Diffstat (limited to 'tests/wsgi')
-rw-r--r--tests/wsgi/tests.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/wsgi/tests.py b/tests/wsgi/tests.py
index f8ee08e387..8ae6296bd1 100644
--- a/tests/wsgi/tests.py
+++ b/tests/wsgi/tests.py
@@ -3,6 +3,7 @@ from django.core.servers.basehttp import get_internal_wsgi_application
from django.core.signals import request_started
from django.core.wsgi import get_wsgi_application
from django.db import close_old_connections
+from django.http import FileResponse
from django.test import SimpleTestCase, override_settings
from django.test.client import RequestFactory
@@ -51,7 +52,8 @@ class WSGITest(SimpleTestCase):
FileResponse uses wsgi.file_wrapper.
"""
class FileWrapper:
- def __init__(self, filelike, blksize=8192):
+ def __init__(self, filelike, block_size=None):
+ self.block_size = block_size
filelike.close()
application = get_wsgi_application()
environ = self.request_factory._base_environ(
@@ -67,6 +69,7 @@ class WSGITest(SimpleTestCase):
response = application(environ, start_response)
self.assertEqual(response_data['status'], '200 OK')
self.assertIsInstance(response, FileWrapper)
+ self.assertEqual(response.block_size, FileResponse.block_size)
class GetInternalWSGIApplicationTest(SimpleTestCase):