@@ -30,6 +30,7 @@ def _no_validate_storage_backend(monkeypatch):
3030 params = [
3131 "pulpcore.app.models.storage.FileSystem" ,
3232 "storages.backends.s3boto3.S3Boto3Storage" ,
33+ "storages.backends.s3.S3Storage" ,
3334 "storages.backends.azure_storage.AzureStorage" ,
3435 ]
3536)
@@ -41,7 +42,10 @@ def storage_class(request):
4142def serializer_class (storage_class ):
4243 if storage_class == "pulpcore.app.models.storage.FileSystem" :
4344 return FileSystemSettingsSerializer
44- elif storage_class == "storages.backends.s3boto3.S3Boto3Storage" :
45+ elif storage_class in (
46+ "storages.backends.s3boto3.S3Boto3Storage" ,
47+ "storages.backends.s3.S3Storage" ,
48+ ):
4549 return AmazonS3SettingsSerializer
4650 elif storage_class == "storages.backends.azure_storage.AzureStorage" :
4751 return AzureSettingsSerializer
@@ -51,7 +55,10 @@ def serializer_class(storage_class):
5155def required_settings (storage_class ):
5256 if storage_class == "pulpcore.app.models.storage.FileSystem" :
5357 return {"location" : "/var/lib/pulp/media/" }
54- elif storage_class == "storages.backends.s3boto3.S3Boto3Storage" :
58+ elif storage_class in (
59+ "storages.backends.s3boto3.S3Boto3Storage" ,
60+ "storages.backends.s3.S3Storage" ,
61+ ):
5562 return {"access_key" : "testing" , "bucket_name" : "test" }
5663 elif storage_class == "storages.backends.azure_storage.AzureStorage" :
5764 return {"account_name" : "test" , "account_key" : "secret" , "azure_container" : "test" }
@@ -60,7 +67,10 @@ def required_settings(storage_class):
6067@pytest .fixture
6168def extra_required_settings (storage_class ):
6269 """For fields required in the serializer's validate, but not on the field itself."""
63- if storage_class == "storages.backends.s3boto3.S3Boto3Storage" :
70+ if storage_class in (
71+ "storages.backends.s3boto3.S3Boto3Storage" ,
72+ "storages.backends.s3.S3Storage" ,
73+ ):
6474 return {"secret_key" : "secret" }
6575 return {}
6676
@@ -129,7 +139,10 @@ def test_using_setting_names(storage_class, serializer_class, all_settings):
129139
130140@pytest .mark .django_db
131141def test_cloudfront_s3_storage_settings (storage_class , required_settings ):
132- if storage_class != "storages.backends.s3boto3.S3Boto3Storage" :
142+ if storage_class not in (
143+ "storages.backends.s3boto3.S3Boto3Storage" ,
144+ "storages.backends.s3.S3Storage" ,
145+ ):
133146 pytest .skip ("This test only make sense when using S3 as storage backend." )
134147
135148 domain = SimpleNamespace (storage_class = storage_class , ** MIN_DOMAIN_SETTINGS )
0 commit comments