"""to_analysis_dict.updated_at 은 KST naive (core.timeutil 규약).""" from datetime import date, timedelta from types import SimpleNamespace from app.core.timeutil import now_kst from app.services import analysis_db_service as svc def test_updated_at_is_kst_naive(): r = SimpleNamespace(**{k: None for k in ( "current_price", "change_rate", "volume", "rsi", "ma5", "ma20", "ma60", "stochastic_k", "stochastic_d", "bollinger_upper", "bollinger_lower", "bollinger_middle", "signals", "score", "ml_score", "ml_confidence", "ml_signal", "atr_14", "adx_14")}) before = now_kst() d = svc.to_analysis_dict("005930", "x", r, date.today()) ts = d["updated_at"] assert ts.tzinfo is None assert before - timedelta(seconds=1) <= ts <= now_kst() + timedelta(seconds=1)