Files
shanxia2.0/backend/tests/test_pl_transport_address_notes_schema.py
zlwuandCursor 22b92ea056 feat(pl): add notes column on transport address library
Persist address-level precautions for later fill into plan load/delivery notes.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-02 11:58:17 +08:00

37 lines
1.1 KiB
Python

"""运输地址库 Schema 接受 notes。"""
from __future__ import annotations
from decimal import Decimal
from app.schemas.pl.transport_address import TransportAddressCreate, TransportAddressUpdate
def test_transport_address_create_accepts_notes():
body = TransportAddressCreate.model_validate(
{
"addressName": "测试仓",
"fullAddress": "安庆市某某路1号",
"lng": Decimal("117.0"),
"lat": Decimal("30.5"),
"notes": "大门左侧卸货",
}
)
assert body.notes == "大门左侧卸货"
def test_transport_address_update_accepts_notes():
body = TransportAddressUpdate.model_validate({"notes": "进厂需报备"})
assert body.notes == "进厂需报备"
def test_transport_address_create_notes_optional():
body = TransportAddressCreate.model_validate(
{
"addressName": "测试仓",
"fullAddress": "安庆市某某路1号",
"lng": Decimal("117.0"),
"lat": Decimal("30.5"),
}
)
assert body.notes is None