diff options
author | Johannes Hoppe <info@johanneshoppe.com> | 2015-11-11 20:17:32 +0100 |
---|---|---|
committer | Tim Graham <timograham@gmail.com> | 2015-12-14 12:46:48 -0500 |
commit | 5233b70070f8979f41ca1da2c1b1d78c8e30944e (patch) | |
tree | 54993a920bb9df5cdfbbc92dc4fbb010a1d662a5 /tests/httpwrappers | |
parent | a6c803a2e3d270818d20f3f0c76e2241de9f0ab1 (diff) | |
download | django-5233b70070f8979f41ca1da2c1b1d78c8e30944e.tar.gz |
Fixed #25725 -- Made HttpReponse immediately close objects.
Diffstat (limited to 'tests/httpwrappers')
-rw-r--r-- | tests/httpwrappers/tests.py | 13 |
1 files changed, 0 insertions, 13 deletions
diff --git a/tests/httpwrappers/tests.py b/tests/httpwrappers/tests.py index 94d269c90b..53dd58da3b 100644 --- a/tests/httpwrappers/tests.py +++ b/tests/httpwrappers/tests.py @@ -588,18 +588,8 @@ class FileCloseTests(SimpleTestCase): # file isn't closed until we close the response. file1 = open(filename) r = HttpResponse(file1) - self.assertFalse(file1.closed) - r.close() self.assertTrue(file1.closed) - - # don't automatically close file when we finish iterating the response. - file1 = open(filename) - r = HttpResponse(file1) - self.assertFalse(file1.closed) - list(r) - self.assertFalse(file1.closed) r.close() - self.assertTrue(file1.closed) # when multiple file are assigned as content, make sure they are all # closed with the response. @@ -607,9 +597,6 @@ class FileCloseTests(SimpleTestCase): file2 = open(filename) r = HttpResponse(file1) r.content = file2 - self.assertFalse(file1.closed) - self.assertFalse(file2.closed) - r.close() self.assertTrue(file1.closed) self.assertTrue(file2.closed) |