'Test that when the File object is deleted, it is removed from the
filesystem.'

def check_delete(self, file_, filename):

    try:
        with public_storage.open(filename, 'w') as f:
            f.write('sample    data\n')
        assert public_storage.exists(filename)
        file_.delete()
        assert (not public_storage.exists(filename))
    finally:
        if public_storage.exists(filename):
            public_storage.delete(filename)
