feat(briefing): add Message.msg_metadata and RssItem.topics/classified_at columns
msg_metadata maps to the 'metadata' DB column ('metadata' is reserved
by SQLAlchemy Declarative API). to_dict() exposes the key as 'metadata'
for frontend compatibility.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -18,3 +18,23 @@ def test_weather_cache_model_exists():
|
||||
from fabledassistant.models.weather_cache import WeatherCache
|
||||
cols = {c.key for c in WeatherCache.__table__.columns}
|
||||
assert {"id", "user_id", "location_key", "location_label", "forecast_json", "previous_json", "fetched_at"} <= cols
|
||||
|
||||
|
||||
def test_message_metadata_field_exists():
|
||||
from fabledassistant.models.conversation import Message
|
||||
|
||||
# DB column is named 'metadata'; Python attribute is 'msg_metadata'
|
||||
# (SQLAlchemy reserves 'metadata' as an attribute name on mapped classes)
|
||||
col_names = {c.name for c in Message.__table__.columns}
|
||||
assert "metadata" in col_names
|
||||
|
||||
m = Message(conversation_id=1, role="assistant", content="hi", msg_metadata={"foo": 1})
|
||||
assert m.msg_metadata == {"foo": 1}
|
||||
|
||||
|
||||
def test_rss_item_topics_field_exists():
|
||||
from fabledassistant.models.rss_feed import RssItem
|
||||
|
||||
cols = {c.key for c in RssItem.__table__.columns}
|
||||
assert "topics" in cols
|
||||
assert "classified_at" in cols
|
||||
|
||||
Reference in New Issue
Block a user