22 lines
572 B
Python
22 lines
572 B
Python
"""测试 Goal ORM 模型新增字段。"""
|
|
|
|
from app.models.governance import Goal
|
|
|
|
|
|
def test_goal_has_character_id():
|
|
"""Goal 模型新增 character_id 字段。"""
|
|
assert hasattr(Goal, "character_id")
|
|
|
|
|
|
def test_goal_has_type():
|
|
"""Goal 模型新增 type 字段,默认 session。"""
|
|
assert hasattr(Goal, "type")
|
|
|
|
|
|
def test_goal_has_progress():
|
|
"""Goal 模型新增 progress 字段,默认 0.0。"""
|
|
goal = Goal(title="test", level="task")
|
|
assert goal.type == "session"
|
|
assert goal.progress == 0.0
|
|
assert goal.character_id is None
|