def test_s3_put_object_on_presigned_url(self):
    bucket_name = ('test-bucket-%s' % short_uid())
    client = self._get_test_client()
    client.create_bucket(Bucket=bucket_name)
    body = 'something body'
    object_key = 'test-presigned-key'
    url = client.generate_presigned_url('put_object', Params={'Bucket': bucket_name, 'Key': object_key})
    response = requests.put(url, data=body, verify=False)
    self.assertEqual(response.status_code, 200)
    downloaded_object = client.get_object(Bucket=bucket_name, Key=object_key)
    download_object = downloaded_object['Body'].read()
    self.assertEqual(to_str(body), to_str(download_object))
    self._delete_bucket(bucket_name, [object_key])
def test_s3_put_object_on_presigned_url(self):
    bucket_name = ('test-bucket-%s' % short_uid())
    client = self._get_test_client()
    client.create_bucket(Bucket=bucket_name)
    body = 'something body'
    object_key = 'test-presigned-key'
    url = client.generate_presigned_url('put_object', Params={'Bucket': bucket_name, 'Key': object_key})
    response = requests.put(url, data=body, verify=False)
    self.assertEqual(response.status_code, 200)
    downloaded_object = client.get_object(Bucket=bucket_name, Key=object_key)
    download_object = downloaded_object['Body'].read()
    self.assertEqual(to_str(body), to_str(download_object))
    self._delete_bucket(bucket_name, [object_key])