From 3a6d80807b53d2dc5f81b8d6cff5fb8b4295bec8 Mon Sep 17 00:00:00 2001 From: Alexander Todorov Date: Sun, 5 Jan 2025 13:53:40 +0200 Subject: [PATCH] Replace deprecated STATICFILES_STORAGE setting with STORAGES --- tcms/core/tests/test_collectstatic.py | 8 ++++++-- tcms/settings/devel.py | 4 +++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/tcms/core/tests/test_collectstatic.py b/tcms/core/tests/test_collectstatic.py index 22cf034493..009089b679 100644 --- a/tcms/core/tests/test_collectstatic.py +++ b/tcms/core/tests/test_collectstatic.py @@ -10,7 +10,7 @@ class TestCollectstatic(TestCase): """ Test manage.py collectstatic --noinput --link - with different versions of STATICFILES_STORAGE. See + with different versions of STORAGES["staticfiles"]. See https://github.com/sehmaschine/django-grappelli/issues/1022 """ @@ -23,7 +23,11 @@ class TestCollectstatic(TestCase): ) def test_collect_static(self, storage): # pylint: disable=no-self-use with override_settings( - STATICFILES_STORAGE=storage, + STORAGES={ + "staticfiles": { + "BACKEND": storage, + }, + }, STATIC_ROOT=tempfile.mkdtemp(), STATICFILES_DIRS=[ # pylint: disable=avoid-list-comprehension dir diff --git a/tcms/settings/devel.py b/tcms/settings/devel.py index 73aca8866e..cce1303e73 100644 --- a/tcms/settings/devel.py +++ b/tcms/settings/devel.py @@ -41,6 +41,8 @@ # http://docs.djangoproject.com/en/dev/ref/templates/api/#django-template-context-processors-debug INTERNAL_IPS = ("127.0.0.1",) -STATICFILES_STORAGE = "tcms.tests.storage.RaiseWhenFileNotFound" +STORAGES["staticfiles"][ # noqa: F405 + "BACKEND" +] = "tcms.tests.storage.RaiseWhenFileNotFound" ANONYMOUS_ANALYTICS = False