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:
17
apps/gallery/tests/unit/test_schemas.py
Normal file
17
apps/gallery/tests/unit/test_schemas.py
Normal file
@@ -0,0 +1,17 @@
|
||||
from types import SimpleNamespace
|
||||
|
||||
import pytest
|
||||
|
||||
from apps.gallery.api.schemas import GalleryCreateSchema, GallerySchema
|
||||
|
||||
|
||||
pytestmark = pytest.mark.unit
|
||||
|
||||
|
||||
def test_gallery_create_defaults_to_public():
|
||||
assert GalleryCreateSchema(title="Photo").is_public
|
||||
|
||||
|
||||
def test_gallery_image_resolver_handles_missing_image():
|
||||
request = SimpleNamespace(build_absolute_uri=lambda url: f"https://example.test{url}")
|
||||
assert GallerySchema.resolve_absolute_image_url(SimpleNamespace(image=None), {"request": request}) is None
|
||||
Reference in New Issue
Block a user