diff options
| author | Claude Paroz <claude@2xlibre.net> | 2015-01-23 09:05:46 +0100 |
|---|---|---|
| committer | Claude Paroz <claude@2xlibre.net> | 2015-01-23 09:09:48 +0100 |
| commit | f8e4e4a935512aedf815f6aee85bc797b498ea75 (patch) | |
| tree | 8fefdeb96d3d29113ebd97b74040f1a87095dca4 | |
| parent | 4135d837027eac43ec416856d9476c478167d8a6 (diff) | |
Fixed warning leak in static.serve() test
Partial forward port of b1bf8d64fb from 1.7.x. Refs #24193.
| -rw-r--r-- | docs/releases/1.7.4.txt | 3 | ||||
| -rw-r--r-- | tests/view_tests/tests/test_static.py | 1 |
2 files changed, 4 insertions, 0 deletions
diff --git a/docs/releases/1.7.4.txt b/docs/releases/1.7.4.txt index 5f10e5e8c6..0d53459068 100644 --- a/docs/releases/1.7.4.txt +++ b/docs/releases/1.7.4.txt @@ -17,3 +17,6 @@ Bugfixes * Fixed a migration crash on MySQL when migrating from a ``OneToOneField`` to a ``ForeignKey`` (:ticket:`24163`). + +* Prevented the ``static.serve`` view from producing ``ResourceWarning``\s in + certain circumstances (security fix regression, :ticket:`24193`). diff --git a/tests/view_tests/tests/test_static.py b/tests/view_tests/tests/test_static.py index 808c07d605..5a353806e1 100644 --- a/tests/view_tests/tests/test_static.py +++ b/tests/view_tests/tests/test_static.py @@ -38,6 +38,7 @@ class StaticTests(SimpleTestCase): first_chunk = next(response.streaming_content) self.assertEqual(len(first_chunk), FileResponse.block_size) second_chunk = next(response.streaming_content) + response.close() # strip() to prevent OS line endings from causing differences self.assertEqual(len(second_chunk.strip()), 1449) |
