24 lines
703 B
Python
24 lines
703 B
Python
"""生产完成任务/工单状态级联。"""
|
|
import unittest
|
|
from datetime import datetime
|
|
from unittest.mock import MagicMock, patch
|
|
|
|
from pydantic import ValidationError
|
|
|
|
from app.schemas.production_work_order import ProductionWorkOrderComplete
|
|
|
|
|
|
class TestProductionWorkOrderCompleteSchema(unittest.TestCase):
|
|
def test_requires_conclusion(self):
|
|
with self.assertRaises(ValidationError):
|
|
ProductionWorkOrderComplete()
|
|
|
|
def test_accepts_cg_and_remark(self):
|
|
body = ProductionWorkOrderComplete(conclusion="cg", remark="ok")
|
|
self.assertEqual(body.conclusion, "cg")
|
|
self.assertEqual(body.remark, "ok")
|
|
|
|
|
|
if __name__ == "__main__":
|
|
unittest.main()
|