def clear_bucket(self):
"""
Empty S3 Bucket to ensure no cross-contamination between tests
"""
logging.info('Clearing bucket...')
contents = s3_utils.s3.list_objects(Bucket = settings.AWS_STORAGE_BUCKET_NAME)
if 'Contents' in contents:
for obj in contents['Contents']:
s3_utils.delete_s3_object(obj['Key'])
评论列表
文章目录