index 26808f7..1e038c0 100644
|
|
|
1 | 1 | import shutil |
2 | 2 | import sys |
| 3 | import gzip |
3 | 4 | |
4 | 5 | from django.core.cache import cache |
5 | 6 | from django.core.files.base import ContentFile |
… |
… |
class FileTests(TestCase):
|
95 | 96 | obj4.random.save("random_file", ContentFile("random content")) |
96 | 97 | self.assertTrue(obj4.random.name.endswith("/random_file")) |
97 | 98 | |
| 99 | # Verify fix for #14681, File like objects should not explicitly set |
| 100 | # mode=None for compatibility with stdlib gzip |
| 101 | file = SimpleUploadedFile("gzip_test.txt", "content") |
| 102 | self.assertFalse(hasattr(g, 'mode')) |
| 103 | g = gzip.GzipFile(fileobj=file) |
| 104 | |
98 | 105 | # Clean up the temporary files and dir. |
99 | 106 | obj1.normal.delete() |
100 | 107 | obj2.normal.delete() |