Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

Close file after tests added in 945e033.

Avoids failures on Windows. Refs #8918.
  • Loading branch information...
commit 8ab5f1fe4750105dae734764baed54bd4d22792b 1 parent 1ac534a
Ramiro Morales authored
Showing with 4 additions and 0 deletions.
  1. +4 −0 tests/files/
4 tests/files/
@@ -65,6 +65,7 @@ def test_files(self):"django_test.txt", ContentFile("more content"))
self.assertEqual(, "tests/django_test_1.txt")
self.assertEqual(obj2.normal.size, 12)
+ obj2.normal.close()
# Push the objects into the cache to make sure they pickle properly
cache.set("obj1", obj1)
@@ -75,6 +76,7 @@ def test_files(self):
obj2.delete()"django_test.txt", ContentFile("more content"))
self.assertEqual(, "tests/django_test_2.txt")
+ obj2.normal.close()
# Multiple files with the same name get _N appended to them.
objs = [Storage() for i in range(3)]
@@ -105,12 +107,14 @@ def test_files(self):
obj4 = Storage()"random_file", ContentFile("random content"))
+ obj4.random.close()
# upload_to can be empty, meaning it does not use subdirectory.
obj5 = Storage()'django_test.txt', ContentFile('more content'))
self.assertEqual(, "./django_test.txt")
self.assertEqual(, b"more content")
+ obj5.empty.close()
def test_file_object(self):
# Create sample file

0 comments on commit 8ab5f1f

Please sign in to comment.
Something went wrong with that request. Please try again.