diff --git a/collectfast/tests/command/test_command.py b/collectfast/tests/command/test_command.py index abad1c6..10540c7 100644 --- a/collectfast/tests/command/test_command.py +++ b/collectfast/tests/command/test_command.py @@ -19,25 +19,18 @@ STATICFILES_STORAGE="storages.backends.s3boto3.S3Boto3Storage", COLLECTFAST_STRATEGY="collectfast.strategies.boto3.Boto3Strategy", ), - "boto": override_django_settings( - STATICFILES_STORAGE="storages.backends.s3boto.S3BotoStorage", - COLLECTFAST_STRATEGY="collectfast.strategies.boto.BotoStrategy", +} +all_backend_confs = { + **aws_backend_confs, + "gcloud": override_django_settings( + STATICFILES_STORAGE="storages.backends.gcloud.GoogleCloudStorage", + COLLECTFAST_STRATEGY="collectfast.strategies.gcloud.GoogleCloudStrategy", + ), + "filesystem": override_django_settings( + STATICFILES_STORAGE="django.core.files.storage.FileSystemStorage", + COLLECTFAST_STRATEGY="collectfast.strategies.filesystem.FileSystemStrategy", ), } -# use PEP448-style unpacking instead of copy+update once 3.4 support is dropped -all_backend_confs = aws_backend_confs.copy() -all_backend_confs.update( - { - "gcloud": override_django_settings( - STATICFILES_STORAGE="storages.backends.gcloud.GoogleCloudStorage", - COLLECTFAST_STRATEGY="collectfast.strategies.gcloud.GoogleCloudStrategy", - ), - "filesystem": override_django_settings( - STATICFILES_STORAGE="django.core.files.storage.FileSystemStorage", - COLLECTFAST_STRATEGY="collectfast.strategies.filesystem.FileSystemStrategy", - ), - } -) make_test_aws_backends = test_many(**aws_backend_confs) make_test_all_backends = test_many(**all_backend_confs) @@ -89,26 +82,8 @@ def test_aws_is_gzipped(case: TestCase) -> None: case.assertIn("0 static files copied.", call_collectstatic()) -@make_test -@override_django_settings( - STATICFILES_STORAGE="storages.backends.s3boto.S3BotoStorage", - COLLECTFAST_STRATEGY=None, -) -def test_recognizes_boto_storage(case: TestCase) -> None: - case.assertEqual(Command._load_strategy().__name__, "BotoStrategy") - - -@make_test -@override_django_settings( - STATICFILES_STORAGE="storages.backends.s3boto3.S3Boto3Storage", - COLLECTFAST_STRATEGY=None, -) -def test_recognizes_boto3_storage(case: TestCase) -> None: - case.assertEqual(Command._load_strategy().__name__, "Boto3Strategy") - - @make_test @override_django_settings(STATICFILES_STORAGE=None, COLLECTFAST_STRATEGY=None) -def test_raises_for_unrecognized_storage(case: TestCase) -> None: +def test_raises_for_no_configured_strategy(case: TestCase) -> None: with case.assertRaises(ImproperlyConfigured): Command._load_strategy() diff --git a/setup.py b/setup.py index f93da78..e98f9e9 100644 --- a/setup.py +++ b/setup.py @@ -17,9 +17,8 @@ license="MIT License", include_package_data=True, install_requires=[ - "Django>=2.0", + "Django>=2.2", "django-storages>=1.6", - 'typing;python_version<"3.5"', "typing-extensions", ], classifiers=[ diff --git a/test-requirements.txt b/test-requirements.txt index 560229e..8349a96 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,4 +1,3 @@ -typing;python_version<"3.5" typing-extensions mock coveralls