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