'Test behavior when file.chunks() is raising an error'

def test_file_chunks_error(self):

    f1 = ContentFile('chunks    fails')
    def failing_chunks():
        raise IOError
    f1.chunks = failing_chunks
    with self.assertRaises(IOError):
        self.storage.save('error.file', f1)
