Skip to content

Commit

Permalink
Replace deprecated STATICFILES_STORAGE setting with STORAGES
Browse files Browse the repository at this point in the history
  • Loading branch information
atodorov committed Jan 5, 2025
1 parent 7f4b34c commit 4de6e6f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
8 changes: 6 additions & 2 deletions tcms/core/tests/test_collectstatic.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
"""

Expand All @@ -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
Expand Down
4 changes: 3 additions & 1 deletion tcms/settings/devel.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 4de6e6f

Please sign in to comment.