test: migrate backend suites to pytest with module coverage gate
Split backend tests into unit and integration suites, add isolated fixtures and coverage enforcement, and update CI and test documentation. Cover current authentication, content, notification, payment, media, and admin flows; fix behaviors revealed by the new tests. Validate both suites and the per-module gate against local PostgreSQL.
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
from tempfile import TemporaryDirectory
|
||||
|
||||
from .base import *
|
||||
|
||||
# Lightweight defaults keep local/CI test runs isolated from production infra.
|
||||
@@ -31,6 +33,9 @@ CACHES = {
|
||||
CELERY_TASK_ALWAYS_EAGER = True
|
||||
CELERY_TASK_EAGER_PROPAGATES = True
|
||||
|
||||
_test_static_root = TemporaryDirectory(prefix="backend-test-static-")
|
||||
STATIC_ROOT = _test_static_root.name
|
||||
|
||||
# Tests should not enforce HTTPS-only cookies to simplify client simulations.
|
||||
CSRF_COOKIE_SECURE = False
|
||||
SESSION_COOKIE_SECURE = False
|
||||
|
||||
Reference in New Issue
Block a user