v1
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
"""
|
||||
Sync import-time tests — specifically the regression where missing email-validator
|
||||
caused the backend to crash on startup.
|
||||
|
||||
These are plain (non-async) tests and deliberately live in a separate file so the
|
||||
module-level `pytestmark = pytest.mark.asyncio` in test_members.py doesn't apply.
|
||||
"""
|
||||
|
||||
|
||||
def test_app_imports_without_error():
|
||||
"""Regression: importing app.main must not raise (email-validator missing)."""
|
||||
import importlib
|
||||
import app.main # noqa: F401 — side-effect: registers all routers
|
||||
importlib.import_module("app.schemas.member") # triggers Pydantic model construction
|
||||
|
||||
|
||||
def test_member_schemas_construct():
|
||||
"""All member Pydantic models can be instantiated — catches EmailStr import errors."""
|
||||
from app.schemas.member import (
|
||||
ClaimRequestSchema,
|
||||
ClaimCompleteSchema,
|
||||
MemberLoginSchema,
|
||||
MemberLoginVerifySchema,
|
||||
MemberProfileUpdate,
|
||||
BookingCreate,
|
||||
AdminCreateMember,
|
||||
)
|
||||
ClaimRequestSchema(email="a@b.com")
|
||||
ClaimCompleteSchema(email="a@b.com", code="ABC123", password="secret99")
|
||||
MemberLoginSchema(email="a@b.com", password="secret99")
|
||||
MemberLoginVerifySchema(email="a@b.com", code="ABC123")
|
||||
MemberProfileUpdate(first_name="Jane")
|
||||
BookingCreate(service_type="pack_walk")
|
||||
AdminCreateMember(email="a@b.com", first_name="Jane", last_name="Doe")
|
||||
Reference in New Issue
Block a user