mirror of
https://github.com/ajurna/cbwebreader.git
synced 2026-11-02 18:46:53 +00:00
- Removed `flake8` and `flake8-annotations` from dependencies, replaced by `ruff` for linting. - Introduced cleaner type hinting and modern Python annotations (PEP 604 style) across multiple modules. - Moved archive processing to a dedicated helper (`comic.archives`) for improved maintainability. - Updated and simplified logic for archive file retrieval, directory cleaning, and user access validation. - Improved error handling and added support for user classification restrictions in API responses.
25 lines
606 B
Python
25 lines
606 B
Python
"""Settings used by the test suite.
|
|
|
|
In-memory SQLite so the tests do not need a running Postgres, and a scratch comic
|
|
volume that the fixtures fill with generated archives.
|
|
"""
|
|
|
|
import os
|
|
from pathlib import Path
|
|
|
|
from cbreader.settings.base import * # noqa: F403
|
|
from cbreader.settings.base import BASE_DIR
|
|
|
|
SECRET_KEY = 'test-secret-key'
|
|
ALLOWED_HOSTS = ['*']
|
|
|
|
DATABASES = {
|
|
'default': {
|
|
'ENGINE': 'django.db.backends.sqlite3',
|
|
'NAME': ':memory:',
|
|
}
|
|
}
|
|
|
|
COMIC_BOOK_VOLUME = Path(os.environ.get('COMIC_TEST_VOLUME', BASE_DIR / 'test_comics'))
|
|
MEDIA_ROOT = BASE_DIR / 'test_media'
|