diff --git a/tests/modeltests/files/tests.py b/tests/modeltests/files/tests.py
index ad5c3a7..fce3b4d 100644
a
|
b
|
class FileTests(TestCase):
|
30 | 30 | self.assertEqual(obj1.normal.name, "tests/django_test.txt") |
31 | 31 | self.assertEqual(obj1.normal.size, 7) |
32 | 32 | self.assertEqual(obj1.normal.read(), "content") |
| 33 | obj1.normal.close() |
33 | 34 | |
34 | 35 | # File objects can be assigned to FileField attributes, but shouldn't |
35 | 36 | # get committed until the model it's attached to is saved. |
… |
… |
class FileTests(TestCase):
|
49 | 50 | self.assertEqual(obj1.normal.read(3), "con") |
50 | 51 | self.assertEqual(obj1.normal.read(), "tent") |
51 | 52 | self.assertEqual(list(obj1.normal.chunks(chunk_size=2)), ["co", "nt", "en", "t"]) |
| 53 | obj1.normal.close() |
52 | 54 | |
53 | 55 | # Save another file with the same name. |
54 | 56 | obj2 = Storage() |
… |
… |
class FileTests(TestCase):
|
81 | 83 | obj3 = Storage.objects.create() |
82 | 84 | self.assertEqual(obj3.default.name, "tests/default.txt") |
83 | 85 | self.assertEqual(obj3.default.read(), "default content") |
| 86 | obj3.default.close() |
84 | 87 | |
85 | 88 | # But it shouldn't be deleted, even if there are no more objects using |
86 | 89 | # it. |
87 | 90 | obj3.delete() |
88 | 91 | obj3 = Storage() |
89 | 92 | self.assertEqual(obj3.default.read(), "default content") |
| 93 | obj3.default.close() |
90 | 94 | |
91 | 95 | # Verify the fix for #5655, making sure the directory is only |
92 | 96 | # determined once. |