| 123456789101112131415161718192021222324252627282930313233343536 |
- """运输地址库 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
|