I have upgraded boto3 from boto3==1.7.48 to 1.13.11
, and this has broken all of my tests that use Moto. It looks like (worryingly) the mock has stopped working altogether and is trying to actually access s3, here is an example test function that was previously working:
def upload_video(self, video):
s3 = boto3.client("s3")
s3.create_bucket(Bucket=settings.AWS_STORAGE_BUCKET_NAME)
for media_key in video.upload_media_keys:
s3.upload_file(
os.path.join(
os.path.dirname(os.path.realpath(__file__)), "assets/test.mp4"
),
settings.AWS_STORAGE_BUCKET_NAME,
media_key,
)
But it now gives this error
File "{path}", line 52, in upload_video
s3.create_bucket(Bucket=settings.AWS_STORAGE_BUCKET_NAME)
File "{path}/lib/python3.7/site-packages/botocore/client.py", line 316, in _api_call
return self._make_api_call(operation_name, kwargs)
File "{path}/lib/python3.7/site-packages/botocore/client.py", line 635, in _make_api_call
raise error_class(parsed_response, operation_name)
botocore.exceptions.ClientError: An error occurred (IllegalLocationConstraintException) when calling the CreateBucket operation: The unspecified location constraint is incompatible for the region specific endpoint this request was sent to.
Any help would be greatly appreciated. Here is the list of upgrades:
Before:
boto3 == 1.7.48
botocore == 1.10.84
moto == 1.3.6
After:
boto3==1.13.11
botocore==1.16.11
moto==1.3.14