diff options
| author | Claude Paroz <claude@2xlibre.net> | 2012-08-29 15:13:20 +0200 |
|---|---|---|
| committer | Claude Paroz <claude@2xlibre.net> | 2012-08-29 16:37:37 +0200 |
| commit | 4e70ad11d29bde54b846920ce0dcf8d10741d3ae (patch) | |
| tree | ab5ae6c4212571d09aad681f16f66326f7962373 /tests/regressiontests/file_storage/tests.py | |
| parent | b5240d25c1bf724f0008478e7f6cccd0a6d6bd1e (diff) | |
Made FileSystemStorage accept both text and byte streams
Thanks Alexey Boriskin for his help on the patch.
Diffstat (limited to 'tests/regressiontests/file_storage/tests.py')
| -rw-r--r-- | tests/regressiontests/file_storage/tests.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/regressiontests/file_storage/tests.py b/tests/regressiontests/file_storage/tests.py index 396e70f5e6..87b509e320 100644 --- a/tests/regressiontests/file_storage/tests.py +++ b/tests/regressiontests/file_storage/tests.py @@ -356,6 +356,17 @@ class FileStorageTests(unittest.TestCase): finally: os.remove = real_remove + def test_file_chunks_error(self): + """ + Test behaviour when file.chunks() is raising an error + """ + f1 = ContentFile('chunks fails') + def failing_chunks(): + raise IOError + f1.chunks = failing_chunks + with self.assertRaises(IOError): + self.storage.save('error.file', f1) + class CustomStorage(FileSystemStorage): def get_available_name(self, name): |
