| 1 |
import os.path |
| 2 |
from pathlib import Path |
| 3 |
|
| 4 |
TEST_ROOT = os.path.dirname(__file__) |
| 5 |
|
| 6 |
TEST_SETTINGS = { |
| 7 |
"MEDIA_URL": "media/", |
| 8 |
"STATIC_URL": "static/", |
| 9 |
"MEDIA_ROOT": os.path.join(TEST_ROOT, "project", "site_media", "media"), |
| 10 |
"STATIC_ROOT": os.path.join(TEST_ROOT, "project", "site_media", "static"), |
| 11 |
"STATICFILES_DIRS": [ |
| 12 |
os.path.join(TEST_ROOT, "project", "documents"), |
| 13 |
("prefix", os.path.join(TEST_ROOT, "project", "prefixed")), |
| 14 |
Path(TEST_ROOT) / "project" / "pathlib", |
| 15 |
], |
| 16 |
"STATICFILES_FINDERS": [ |
| 17 |
"django.contrib.staticfiles.finders.FileSystemFinder", |
| 18 |
"django.contrib.staticfiles.finders.AppDirectoriesFinder", |
| 19 |
"django.contrib.staticfiles.finders.DefaultStorageFinder", |
| 20 |
], |
| 21 |
"INSTALLED_APPS": [ |
| 22 |
"django.contrib.staticfiles", |
| 23 |
"staticfiles_tests", |
| 24 |
"staticfiles_tests.apps.test", |
| 25 |
"staticfiles_tests.apps.no_label", |
| 26 |
], |
| 27 |
# In particular, AuthenticationMiddleware can't be used because |
| 28 |
# contrib.auth isn't in INSTALLED_APPS. |
| 29 |
"MIDDLEWARE": [], |
| 30 |
} |