Files
armonia-api/tests/unit/services/test_timestamps.py
T
kiskaadee 67f41ca2f1 feat(models): implement SQLModel table models, portable database engine, and align INDIVIDUAL schema
- 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
2026-10-19 12:58:59 -05:00

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"