chore: add migration check and optimize password hashing for test settings
This commit is contained in:
parent
39bae9a5c7
commit
fa52fb10d4
2 changed files with 15 additions and 0 deletions
10
.github/workflows/tests.yml
vendored
10
.github/workflows/tests.yml
vendored
|
|
@ -45,6 +45,16 @@ jobs:
|
|||
working-directory: backend
|
||||
run: uv sync --frozen
|
||||
|
||||
# The suite runs with --no-migrations for speed, so nothing else would
|
||||
# catch a model change that is missing its migration.
|
||||
- name: Check for missing migrations
|
||||
working-directory: backend
|
||||
env:
|
||||
DJANGO_SETTINGS_MODULE: crm.test_settings
|
||||
SECRET_KEY: test-secret-key-for-ci
|
||||
ADMIN_EMAIL: admin@test.com
|
||||
run: uv run python manage.py makemigrations --check --dry-run
|
||||
|
||||
- name: Run tests with coverage
|
||||
working-directory: backend
|
||||
env:
|
||||
|
|
|
|||
|
|
@ -17,3 +17,8 @@ DATABASES = {
|
|||
# Disable Celery broker/result backend in tests (no Redis needed)
|
||||
CELERY_BROKER_URL = "memory://"
|
||||
CELERY_RESULT_BACKEND = "cache+memory://"
|
||||
|
||||
# The default PBKDF2 hasher costs ~190ms per hash. Fixtures create users on
|
||||
# nearly every test, so that dominates the run. MD5 is fine here: it is never
|
||||
# used outside crm.test_settings, and no test asserts on the hash algorithm.
|
||||
PASSWORD_HASHERS = ["django.contrib.auth.hashers.MD5PasswordHasher"]
|
||||
|
|
|
|||
Loading…
Reference in a new issue