- Define SQLModel table models for AdminAllowlist, AdminAuditLog, Client, Service, Package, Booking, and Payment with foreign keys and strict validation. - Configure portable SQLModel create_engine in app/db/database.py supporting local SQLite and Turso Cloud (sqlite+libsql://) with PRAGMA foreign_keys = ON. - Provide get_session generator dependency for FastAPI routers. - Align ONE_ON_ONE service type to INDIVIDUAL across schema.sql, routers, seeds, and documentation. - Add unit tests for all models and database connectivity (75 tests passing). Refs: #6
19 lines
482 B
Python
19 lines
482 B
Python
"""
|
|
Behavior-driven test naming convention:
|
|
test_<subject>_<action>_<expected>
|
|
"""
|
|
|
|
from datetime import UTC, datetime
|
|
|
|
import time_machine
|
|
|
|
from app.services.timestamps import utc_now_iso
|
|
|
|
|
|
def test_utc_now_iso_returns_exact_timestamp():
|
|
# freeze time at a known UTC moment
|
|
frozen_time: datetime = datetime(2026, 9, 26, 16, 0, 0, 500000, tzinfo=UTC)
|
|
|
|
with time_machine.travel(frozen_time, tick=False):
|
|
assert utc_now_iso() == "2026-09-26T16:00:00.500000+00:00"
|