Skip to content

Commit

Permalink
fix: fix the test settings for Django 5.1+ and for Django 5.0-
Browse files Browse the repository at this point in the history
  • Loading branch information
d9pouces committed Jan 19, 2025
1 parent 9b438ae commit b117dc8
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions tests/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
import os
import shutil

from django.utils import version


def local_path(path):
return os.path.join(os.path.dirname(__file__), path)
Expand Down Expand Up @@ -42,15 +44,19 @@ def local_path(path):

MEDIA_ROOT = local_path("media")

STATICFILES_STORAGE = "pipeline.storage.PipelineStorage"
STORAGES = {
"default": {
"BACKEND": "pipeline.storage.PipelineStorage",
},
"staticfiles": {
"BACKEND": "pipeline.storage.PipelineStorage",
},
}
django_version = version.get_complete_version()
if django_version >= (4, 2):

STORAGES = {
"default": {
"BACKEND": "pipeline.storage.PipelineStorage",
},
"staticfiles": {
"BACKEND": "pipeline.storage.PipelineStorage",
},
}
else:
STATICFILES_STORAGE = "pipeline.storage.PipelineStorage"
STATIC_ROOT = local_path("static/")
STATIC_URL = "/static/"
STATICFILES_DIRS = (("pipeline", local_path("assets/")),)
Expand Down

0 comments on commit b117dc8

Please sign in to comment.