def test_s3_delete_response_content_length_zero(self):
    bucket_name = ('test-bucket-%s' % short_uid())
    client = self._get_test_client()
    client.create_bucket(Bucket=bucket_name)
    for encoding in (None, 'gzip'):
        object_key = 'key-by-hostname'
        client.put_object(Bucket=bucket_name, Key=object_key, Body='something', ContentType='text/html; charset=utf-8')
        url = client.generate_presigned_url('delete_object', Params={'Bucket': bucket_name, 'Key': object_key})
        headers = {}
        if encoding:
            headers['Accept-Encoding'] = encoding
        response = requests.delete(url, headers=headers, verify=False)
        self.assertEqual(response.headers['content-length'], '0', f'Unexpected response Content-Length for encoding {encoding}')
    self._delete_bucket(bucket_name, [object_key])
def test_s3_delete_response_content_length_zero(self):
    bucket_name = ('test-bucket-%s' % short_uid())
    client = self._get_test_client()
    client.create_bucket(Bucket=bucket_name)
    for encoding in (None, 'gzip'):
        object_key = 'key-by-hostname'
        client.put_object(Bucket=bucket_name, Key=object_key, Body='something', ContentType='text/html; charset=utf-8')
        url = client.generate_presigned_url('delete_object', Params={'Bucket': bucket_name, 'Key': object_key})
        headers = {}
        if encoding:
            headers['Accept-Encoding'] = encoding
        response = requests.delete(url, headers=headers, verify=False)
        self.assertEqual(response.headers['content-length'], '0', f'Unexpected response Content-Length for encoding {encoding}')
    self._delete_bucket(bucket_name, [object_key])