"No","テストID","対象クラス","対象メソッド","テスト観点","テストケース名","前提条件","入力値","期待結果","優先度","備考"
"1","UT-ORD-001","order.models.TotalPriceMixin","save","正常系","保存時に総価格が自動更新されること","注文とline itemsが存在","なし","total_priceが再計算されて保存される","高","金額計算の重要なロジック"
"2","UT-ORD-002","order.models.TotalPriceMixin","currency","正常系","order_currency設定時にその通貨が返却されること","order_currency=USD","なし","USDが返却される","中","通貨優先順位: order_currency > company.currency > default"
"3","UT-ORD-003","order.models.TotalPriceMixin","currency","正常系","order_currency未設定時にcompanyの通貨が返却されること","order_currency=None, company.currency_code=EUR","なし","EURが返却される","中",""
"4","UT-ORD-004","order.models.TotalPriceMixin","currency","正常系","通貨未設定時にデフォルト通貨が返却されること","order_currency=None, company=None","なし","currency_code_default()の値が返却される","中",""
"5","UT-ORD-005","order.models.TotalPriceMixin","update_total_price","正常系","総価格が正しく更新されること","複数のline itemsが存在","commit=True","total_priceが更新され保存される","高",""
"6","UT-ORD-006","order.models.TotalPriceMixin","calculate_total_price","正常系","全line itemsの価格合計が返却されること","line items: qty=2, price=100; qty=3, price=200","target_currency=USD","800 USDが返却される","高","金額計算の重要なロジック"
"7","UT-ORD-007","order.models.TotalPriceMixin","calculate_total_price","正常系","extra_linesを含めた価格合計が返却されること","lines + extra_linesが存在","target_currency=USD","合計金額が正しく計算される","高",""
"8","UT-ORD-008","order.models.TotalPriceMixin","calculate_total_price","異常系","為替レート未設定時にNoneが返却されること","異なる通貨のline itemsあり、為替レートなし","target_currency=JPY","Noneが返却される","中","MissingRate例外処理"
"9","UT-ORD-009","order.models.TotalPriceMixin","calculate_total_price","境界値","PKがNoneの場合に0が返却されること","未保存のインスタンス","target_currency=USD","Money(0, USD)が返却される","中",""
"10","UT-ORD-010","order.models.Order","save","正常系","保存時にreference_intが再構築されること","reference='PO-0001'","なし","reference_intが設定される","中",""
"11","UT-ORD-011","order.models.Order","save","正常系","creation_date未設定時に現在日付が設定されること","新規作成","creation_date=None","current_date()が設定される","中",""
"12","UT-ORD-012","order.models.Order","save","異常系","ロックされた注文の変更でValidationErrorが発生すること","完了済みかつロック設定有効","status以外のフィールド変更","ValidationError発生","高","データ整合性保護"
"13","UT-ORD-013","order.models.Order","check_locked","正常系","未完了の注文でFalseが返却されること","status=PENDING","db=False","Falseが返却される","中",""
"14","UT-ORD-014","order.models.Order","check_locked","正常系","完了注文でUNLOCK_SETTING有効時にFalseが返却されること","status=COMPLETE, UNLOCK_SETTING=True","db=False","Falseが返却される","中",""
"15","UT-ORD-015","order.models.Order","check_complete","正常系","完了ステータス時にTrueが返却されること","status in STATUS_CLASS.COMPLETE","db=False","Trueが返却される","中",""
"16","UT-ORD-016","order.models.Order","clean","異常系","responsibleが必須で未設定時にValidationErrorが発生すること","REQUIRE_RESPONSIBLE_SETTING=True, responsible=None","なし","ValidationError発生","高","認証・認可関連"
"17","UT-ORD-017","order.models.Order","clean","異常系","contactがcompanyと一致しない場合にValidationErrorが発生すること","company=A, contact.company=B","なし","ValidationError発生","中","データ整合性"
"18","UT-ORD-018","order.models.Order","clean","異常系","target_dateがstart_dateより前の場合にValidationErrorが発生すること","start_date=2024-01-10, target_date=2024-01-05","なし","ValidationError発生","中",""
"19","UT-ORD-019","order.models.Order","clean","異常系","addressがcompanyと一致しない場合にValidationErrorが発生すること","company=A, address.company=B","なし","ValidationError発生","中",""
"20","UT-ORD-020","order.models.Order","overdue_filter","正常系","期限切れフィルタが正しいQueryを返すこと","なし","なし","status in OPEN, target_date < today のQ objectが返却される","中",""
"21","UT-ORD-021","order.models.Order","is_overdue","正常系","期限切れ注文でTrueが返却されること","target_date < today, status=OPEN","なし","Trueが返却される","中",""
"22","UT-ORD-022","order.models.Order","is_overdue","正常系","期限内注文でFalseが返却されること","target_date >= today","なし","Falseが返却される","中",""
"23","UT-ORD-023","order.models.Order","report_context","正常系","レポートコンテキストが正しく生成されること","注文が存在","なし","description, extra_lines, lines, order, reference, titleを含むdictが返却される","低",""
"24","UT-ORD-024","order.models.PurchaseOrder","__str__","正常系","文字列表現が正しいフォーマットで返却されること","reference='PO-001', supplier.name='Supplier A'","なし","'PO-001 - Supplier A'が返却される","低",""
"25","UT-ORD-025","order.models.PurchaseOrder","__str__","異常系","supplier削除時に'deleted'が表示されること","supplier=None","なし","'PO-001 - deleted'が返却される","低",""
"26","UT-ORD-026","order.models.PurchaseOrder","get_absolute_url","正常系","正しいURLが返却されること","pk=123","なし","'/purchasing/purchase-order/123'を含むURLが返却される","低",""
"27","UT-ORD-027","order.models.PurchaseOrder","get_api_url","正常系","API URLが返却されること","なし","なし","'api-po-list'のreverse URLが返却される","低",""
"28","UT-ORD-028","order.models.PurchaseOrder","get_status_class","正常系","PurchaseOrderStatusGroupsが返却されること","なし","なし","PurchaseOrderStatusGroupsクラスが返却される","低",""
"29","UT-ORD-029","order.models.PurchaseOrder","api_defaults","正常系","デフォルト値に次のreferenceが含まれること","なし","request=None","{'reference': 'PO-XXX'}形式のdictが返却される","低",""
"30","UT-ORD-030","order.models.PurchaseOrder","barcode_model_type_code","正常系","'PO'が返却されること","なし","なし","'PO'が返却される","低",""
"31","UT-ORD-031","order.models.PurchaseOrder","subscribed_users","正常系","購読ユーザーリストが返却されること","line itemsにpartあり、partに購読者あり","なし","購読ユーザーのリストが返却される","中",""
"32","UT-ORD-032","order.models.PurchaseOrder","status_text","正常系","ステータステキストが返却されること","status=PENDING","なし","'Pending'が返却される","低",""
"33","UT-ORD-033","order.models.PurchaseOrder","company","正常系","supplierが返却されること","supplier=CompanyA","なし","CompanyAが返却される","低","Order基底クラスとの互換性"
"34","UT-ORD-034","order.models.PurchaseOrder","add_line_item","正常系","新規line itemが作成されること","supplier_part, quantity=10","group=False","PurchaseOrderLineItemが作成される","高",""
"35","UT-ORD-035","order.models.PurchaseOrder","add_line_item","正常系","既存line itemに数量が追加されること","同じsupplier_partのline itemが存在","group=True, quantity=5","既存line itemのquantityが増加","中",""
"36","UT-ORD-036","order.models.PurchaseOrder","add_line_item","異常系","数量が0以下でValidationErrorが発生すること","supplier_part","quantity=0","ValidationError発生","高","バリデーション"
"37","UT-ORD-037","order.models.PurchaseOrder","add_line_item","異常系","数量が整数でない場合にValidationErrorが発生すること","supplier_part","quantity='abc'","ValidationError発生","中",""
"38","UT-ORD-038","order.models.PurchaseOrder","add_line_item","異常系","supplier_partのsupplierがPOと異なる場合にValidationErrorが発生すること","PO.supplier=A, supplier_part.supplier=B","quantity=10","ValidationError発生","高","データ整合性"
"39","UT-ORD-039","order.models.PurchaseOrder","_action_place","正常系","PLACEDステータスに遷移すること","status=PENDING","なし","status=PLACED, issue_dateが設定される","高","状態遷移"
"40","UT-ORD-040","order.models.PurchaseOrder","_action_place","状態遷移","PENDING以外からは遷移しないこと","status=COMPLETE","なし","ステータス変更なし","中",""
"41","UT-ORD-041","order.models.PurchaseOrder","_action_complete","正常系","COMPLETEステータスに遷移すること","status=PLACED","なし","status=COMPLETE, complete_dateが設定される","高","状態遷移"
"42","UT-ORD-042","order.models.PurchaseOrder","can_issue","正常系","PENDING/ON_HOLDでTrueが返却されること","status=PENDING","なし","Trueが返却される","中",""
"43","UT-ORD-043","order.models.PurchaseOrder","can_issue","正常系","COMPLETE/CANCELLEDでFalseが返却されること","status=COMPLETE","なし","Falseが返却される","中",""
"44","UT-ORD-044","order.models.PurchaseOrder","place_order","正常系","PLACEDへの遷移が実行されること","status=PENDING","なし","handle_transitionが呼ばれる","高",""
"45","UT-ORD-045","order.models.PurchaseOrder","complete_order","正常系","COMPLETEへの遷移が実行されること","status=PLACED","なし","handle_transitionが呼ばれる","高",""
"46","UT-ORD-046","order.models.PurchaseOrder","hold_order","正常系","ON_HOLDへの遷移が実行されること","status=PENDING","なし","handle_transitionが呼ばれる","中",""
"47","UT-ORD-047","order.models.PurchaseOrder","cancel_order","正常系","CANCELLEDへの遷移が実行されること","status=PENDING","なし","handle_transitionが呼ばれる","中",""
"48","UT-ORD-048","order.models.PurchaseOrder","can_cancel","正常系","OPENステータスでTrueが返却されること","status in OPEN","なし","Trueが返却される","中",""
"49","UT-ORD-049","order.models.PurchaseOrder","_action_cancel","正常系","CANCELLEDステータスに遷移すること","status=PENDING","なし","status=CANCELLEDになる","中",""
"50","UT-ORD-050","order.models.PurchaseOrder","can_hold","正常系","PENDING/PLACEDでTrueが返却されること","status=PENDING","なし","Trueが返却される","中",""
"51","UT-ORD-051","order.models.PurchaseOrder","_action_hold","正常系","ON_HOLDステータスに遷移すること","status=PENDING","なし","status=ON_HOLDになる","中",""
"52","UT-ORD-052","order.models.PurchaseOrder","pending_line_items","正常系","未完了line itemsが返却されること","qty=10, received=5のline itemあり","なし","received < quantityのline itemsが返却される","中",""
"53","UT-ORD-053","order.models.PurchaseOrder","completed_line_items","正常系","完了line itemsが返却されること","qty=10, received=10のline itemあり","なし","received >= quantityのline itemsが返却される","中",""
"54","UT-ORD-054","order.models.PurchaseOrder","line_count","正常系","line items数が返却されること","3つのline itemsあり","なし","3が返却される","低",""
"55","UT-ORD-055","order.models.PurchaseOrder","completed_line_count","正常系","完了line items数が返却されること","2つの完了line itemsあり","なし","2が返却される","低",""
"56","UT-ORD-056","order.models.PurchaseOrder","pending_line_count","正常系","未完了line items数が返却されること","1つの未完了line itemあり","なし","1が返却される","低",""
"57","UT-ORD-057","order.models.PurchaseOrder","is_complete","正常系","全line items完了時にTrueが返却されること","全line itemsでreceived >= quantity","なし","Trueが返却される","中",""
"58","UT-ORD-058","order.models.PurchaseOrder","is_complete","正常系","未完了line items存在時にFalseが返却されること","未完了line itemあり","なし","Falseが返却される","中",""
"59","UT-ORD-059","order.models.PurchaseOrder","is_pending","正常系","PENDINGステータス時にTrueが返却されること","status=PENDING","なし","Trueが返却される","低",""
"60","UT-ORD-060","order.models.PurchaseOrder","is_open","正常系","OPENグループステータス時にTrueが返却されること","status=PLACED","なし","Trueが返却される","低",""
"61","UT-ORD-061","order.models.PurchaseOrder","receive_line_items","正常系","複数line itemsを受領しStockItemsが作成されること","status=PLACED, line items指定","items=[{line_item, quantity}]","StockItemsが作成される","高","在庫数量関連"
"62","UT-ORD-062","order.models.PurchaseOrder","receive_line_items","異常系","PLACEDステータス以外でValidationErrorが発生すること","status=PENDING","items指定","ValidationError発生","高",""
"63","UT-ORD-063","order.models.PurchaseOrder","receive_line_items","異常系","負の数量でValidationErrorが発生すること","status=PLACED","quantity=-1","ValidationError発生","高","バリデーション"
"64","UT-ORD-064","order.models.PurchaseOrder","receive_line_items","正常系","シリアル番号指定時に複数StockItemsが作成されること","status=PLACED","serials=['SN1', 'SN2']","2つのStockItemsが作成される","高",""
"65","UT-ORD-065","order.models.PurchaseOrder","receive_line_items","正常系","build_orderリンク時に正しく処理されること","status=PLACED, line item with build_order","items指定","build orderとの関連が正しく設定される","高",""
"66","UT-ORD-066","order.models.PurchaseOrder","receive_line_items","正常系","自動完了設定時に注文が完了すること","PURCHASEORDER_AUTO_COMPLETE=True, 全line items受領","items指定","status=COMPLETEになる","高",""
"67","UT-ORD-067","order.models.PurchaseOrder","receive_line_item","正常系","単一line itemが受領されること","status=PLACED, line item指定","line, location, quantity, user","receive_line_itemsが呼ばれる","中","ラッパーメソッド"
"68","UT-ORD-068","order.models.SalesOrder","__str__","正常系","文字列表現が正しいフォーマットで返却されること","reference='SO-001', customer.name='Customer A'","なし","'SO-001 - Customer A'が返却される","低",""
"69","UT-ORD-069","order.models.SalesOrder","get_absolute_url","正常系","正しいURLが返却されること","pk=456","なし","'/sales/sales-order/456'を含むURLが返却される","低",""
"70","UT-ORD-070","order.models.SalesOrder","get_api_url","正常系","API URLが返却されること","なし","なし","'api-so-list'のreverse URLが返却される","低",""
"71","UT-ORD-071","order.models.SalesOrder","barcode_model_type_code","正常系","'SO'が返却されること","なし","なし","'SO'が返却される","低",""
"72","UT-ORD-072","order.models.SalesOrder","subscribed_users","正常系","購読ユーザーリストが返却されること","line itemsにpartあり","なし","購読ユーザーのリストが返却される","中",""
"73","UT-ORD-073","order.models.SalesOrder","company","正常系","customerが返却されること","customer=CompanyB","なし","CompanyBが返却される","低",""
"74","UT-ORD-074","order.models.SalesOrder","is_pending","正常系","PENDINGステータス時にTrueが返却されること","status=PENDING","なし","Trueが返却される","低",""
"75","UT-ORD-075","order.models.SalesOrder","is_open","正常系","OPENグループステータス時にTrueが返却されること","status=IN_PROGRESS","なし","Trueが返却される","低",""
"76","UT-ORD-076","order.models.SalesOrder","stock_allocations","正常系","全allocationsが返却されること","allocationsあり","なし","SalesOrderAllocationのQuerySetが返却される","中",""
"77","UT-ORD-077","order.models.SalesOrder","is_fully_allocated","正常系","全line items割当済みでTrueが返却されること","全line itemsが完全割当済み","なし","Trueが返却される","中",""
"78","UT-ORD-078","order.models.SalesOrder","is_fully_allocated","正常系","未割当line itemありでFalseが返却されること","未割当line itemあり","なし","Falseが返却される","中",""
"79","UT-ORD-079","order.models.SalesOrder","is_overallocated","正常系","過剰割当line itemありでTrueが返却されること","過剰割当line itemあり","なし","Trueが返却される","中",""
"80","UT-ORD-080","order.models.SalesOrder","is_completed","正常系","全line items出荷済みでTrueが返却されること","全line itemsでshipped >= quantity","なし","Trueが返却される","中",""
"81","UT-ORD-081","order.models.SalesOrder","is_completed","正常系","virtualパーツは無視されること","virtualパーツのみ未出荷","なし","Trueが返却される","中",""
"82","UT-ORD-082","order.models.SalesOrder","can_complete","正常系","完了可能な場合にTrueが返却されること","全条件満たす","raise_error=False","Trueが返却される","中",""
"83","UT-ORD-083","order.models.SalesOrder","can_complete","異常系","既に完了済みでValidationErrorが発生すること","status=COMPLETE","raise_error=True","ValidationError発生","中",""
"84","UT-ORD-084","order.models.SalesOrder","can_complete","異常系","未完了shipmentありでValidationErrorが発生すること","pending_shipment_count > 0","raise_error=True","ValidationError発生","高",""
"85","UT-ORD-085","order.models.SalesOrder","can_complete","異常系","未完了allocationありでValidationErrorが発生すること","pending_allocation_count > 0","raise_error=True","ValidationError発生","高",""
"86","UT-ORD-086","order.models.SalesOrder","can_issue","正常系","PENDING/ON_HOLDでTrueが返却されること","status=PENDING","なし","Trueが返却される","中",""
"87","UT-ORD-087","order.models.SalesOrder","_action_place","正常系","IN_PROGRESSステータスに遷移すること","status=PENDING","なし","status=IN_PROGRESS, issue_dateが設定される","高","状態遷移"
"88","UT-ORD-088","order.models.SalesOrder","can_hold","正常系","PENDING/IN_PROGRESSでTrueが返却されること","status=PENDING","なし","Trueが返却される","中",""
"89","UT-ORD-089","order.models.SalesOrder","_action_hold","正常系","ON_HOLDステータスに遷移すること","status=PENDING","なし","status=ON_HOLDになる","中",""
"90","UT-ORD-090","order.models.SalesOrder","_action_complete","正常系","SHIPPED/COMPLETEステータスに遷移すること","全条件満たす","user指定","status変更, shipment_date設定","高","状態遷移"
"91","UT-ORD-091","order.models.SalesOrder","_action_complete","正常系","virtualパーツのshipped数量が更新されること","virtualパーツのline itemあり","user指定","shipped=quantityになる","中",""
"92","UT-ORD-092","order.models.SalesOrder","can_cancel","正常系","OPENステータスでTrueが返却されること","status=IN_PROGRESS","なし","Trueが返却される","中",""
"93","UT-ORD-093","order.models.SalesOrder","_action_cancel","正常系","CANCELLEDステータスに遷移しallocationsが削除されること","status=IN_PROGRESS, allocationsあり","なし","status=CANCELLED, allocations削除","高","状態遷移"
"94","UT-ORD-094","order.models.SalesOrder","issue_order","正常系","IN_PROGRESSへの遷移が実行されること","status=PENDING","なし","handle_transitionが呼ばれる","高",""
"95","UT-ORD-095","order.models.SalesOrder","ship_order","正常系","SHIPPEDへの遷移が実行されること","完了可能な状態","user指定","handle_transitionが呼ばれる","高",""
"96","UT-ORD-096","order.models.SalesOrder","complete_order","正常系","COMPLETEへの遷移が実行されること","完了可能な状態","user指定","handle_transitionが呼ばれる","高",""
"97","UT-ORD-097","order.models.SalesOrder","pending_line_items","正常系","未完了line itemsが返却されること","shipped < quantityのline itemあり","なし","未完了line itemsが返却される","中",""
"98","UT-ORD-098","order.models.SalesOrder","completed_line_items","正常系","完了line itemsが返却されること","shipped >= quantityのline itemあり","なし","完了line itemsが返却される","中",""
"99","UT-ORD-099","order.models.SalesOrder","completed_shipments","正常系","完了shipmentが返却されること","shipment_date設定済みのshipmentあり","なし","完了shipmentsが返却される","中",""
"100","UT-ORD-100","order.models.SalesOrder","pending_shipments","正常系","未完了shipmentが返却されること","shipment_date=Noneのshipmentあり","なし","未完了shipmentsが返却される","中",""
"101","UT-ORD-101","order.models.SalesOrder","allocations","正常系","全allocationsが返却されること","allocationsあり","なし","SalesOrderAllocationのQuerySetが返却される","中",""
"102","UT-ORD-102","order.models.SalesOrder","pending_allocations","正常系","未出荷allocationsが返却されること","未出荷allocationsあり","なし","shipment=None または shipment.shipment_date=Noneのallocationsが返却される","中",""
"103","UT-ORD-103","order.models.OrderLineItem","save","異常系","ロックされた注文のline item変更でValidationErrorが発生すること","order.check_locked()=True","なし","ValidationError発生","高","データ整合性"
"104","UT-ORD-104","order.models.OrderLineItem","save","正常系","保存時にorderのsaveが呼ばれること","order存在","update_order=True","order.save()が呼ばれる","中",""
"105","UT-ORD-105","order.models.OrderLineItem","delete","異常系","ロックされた注文のline item削除でValidationErrorが発生すること","order.check_locked()=True","なし","ValidationError発生","高","データ整合性"
"106","UT-ORD-106","order.models.OrderLineItem","total_line_price","正常系","quantity * priceが返却されること","quantity=5, price=100","なし","500が返却される","高","金額計算"
"107","UT-ORD-107","order.models.OrderLineItem","total_line_price","境界値","price未設定時にNoneが返却されること","quantity=5, price=None","なし","Noneが返却される","中",""
"108","UT-ORD-108","order.models.PurchaseOrderLineItem","clean","異常系","supplier_partのsupplierがorderと異なる場合にValidationErrorが発生すること","order.supplier=A, part.supplier=B","なし","ValidationError発生","高","データ整合性"
"109","UT-ORD-109","order.models.PurchaseOrderLineItem","clean","異常系","build_orderが外部でない場合にValidationErrorが発生すること","build_order.external=False","なし","ValidationError発生","高",""
"110","UT-ORD-110","order.models.PurchaseOrderLineItem","clean","異常系","build_orderのpartが一致しない場合にValidationErrorが発生すること","build_order.part != part.part","なし","ValidationError発生","高",""
"111","UT-ORD-111","order.models.PurchaseOrderLineItem","__str__","正常系","文字列表現が正しいフォーマットで返却されること","quantity=10, part.SKU='SKU-001'","なし","'10 x SKU-001 - PO-001'形式が返却される","低",""
"112","UT-ORD-112","order.models.PurchaseOrderLineItem","get_base_part","正常系","base partが返却されること","part.part=PartA","なし","PartAが返却される","中",""
"113","UT-ORD-113","order.models.PurchaseOrderLineItem","get_base_part","境界値","part未設定時にNoneが返却されること","part=None","なし","Noneが返却される","中",""
"114","UT-ORD-114","order.models.PurchaseOrderLineItem","price","正常系","purchase_priceが返却されること","purchase_price=100","なし","100が返却される","低",""
"115","UT-ORD-115","order.models.PurchaseOrderLineItem","get_destination","正常系","line itemのdestinationが返却されること","destination=LocationA","なし","LocationAが返却される","中",""
"116","UT-ORD-116","order.models.PurchaseOrderLineItem","get_destination","正常系","orderのdestinationが返却されること","destination=None, order.destination=LocationB","なし","LocationBが返却される","中",""
"117","UT-ORD-117","order.models.PurchaseOrderLineItem","get_destination","正常系","partのdefault_locationが返却されること","destination=None, order.destination=None, part.part.default_location=LocationC","なし","LocationCが返却される","中",""
"118","UT-ORD-118","order.models.PurchaseOrderLineItem","remaining","正常系","残数量が返却されること","quantity=10, received=3","なし","7が返却される","中",""
"119","UT-ORD-119","order.models.PurchaseOrderLineItem","remaining","境界値","負の値にならないこと","quantity=5, received=10","なし","0が返却される","中",""
"120","UT-ORD-120","order.models.PurchaseOrderLineItem","is_completed","正常系","received >= quantityでTrueが返却されること","quantity=10, received=10","なし","Trueが返却される","中",""
"121","UT-ORD-121","order.models.PurchaseOrderLineItem","update_pricing","正常系","supplier partの価格で更新されること","part.get_price()=1000, quantity=10","なし","purchase_price=100に更新される","高","金額計算"
"122","UT-ORD-122","order.models.SalesOrderLineItem","clean","異常系","salable=Falseのpartが指定された場合にValidationErrorが発生すること","part.salable=False","なし","ValidationError発生","高","バリデーション"
"123","UT-ORD-123","order.models.SalesOrderLineItem","price","正常系","sale_priceが返却されること","sale_price=150","なし","150が返却される","低",""
"124","UT-ORD-124","order.models.SalesOrderLineItem","fulfilled_quantity","正常系","出荷済み数量が返却されること","stock_itemsあり","なし","stock_items.quantity合計が返却される","中",""
"125","UT-ORD-125","order.models.SalesOrderLineItem","fulfilled_quantity","境界値","PK未設定時に0が返却されること","未保存インスタンス","なし","0が返却される","中",""
"126","UT-ORD-126","order.models.SalesOrderLineItem","allocated_quantity","正常系","割当済み数量が返却されること","allocationsあり","なし","allocations.quantity合計が返却される","中",""
"127","UT-ORD-127","order.models.SalesOrderLineItem","allocated_quantity","境界値","PK未設定時に0が返却されること","未保存インスタンス","なし","0が返却される","中",""
"128","UT-ORD-128","order.models.SalesOrderLineItem","is_fully_allocated","正常系","完全割当時にTrueが返却されること","allocated_quantity >= quantity","なし","Trueが返却される","中",""
"129","UT-ORD-129","order.models.SalesOrderLineItem","is_fully_allocated","正常系","virtualパーツでTrueが返却されること","part.virtual=True","なし","Trueが返却される","中",""
"130","UT-ORD-130","order.models.SalesOrderLineItem","is_overallocated","正常系","過剰割当時にTrueが返却されること","allocated_quantity > quantity","なし","Trueが返却される","中",""
"131","UT-ORD-131","order.models.SalesOrderLineItem","is_completed","正常系","shipped >= quantityでTrueが返却されること","shipped=10, quantity=10","なし","Trueが返却される","中",""
"132","UT-ORD-132","order.models.SalesOrderLineItem","is_completed","正常系","virtualパーツでTrueが返却されること","part.virtual=True","なし","Trueが返却される","中",""
"133","UT-ORD-133","order.models.SalesOrderShipment","clean","異常系","shipment_addressがcustomerと一致しない場合にValidationErrorが発生すること","order.customer=A, shipment_address.company=B","なし","ValidationError発生","中","データ整合性"
"134","UT-ORD-134","order.models.SalesOrderShipment","get_api_url","正常系","API URLが返却されること","なし","なし","'api-so-shipment-list'のreverse URLが返却される","低",""
"135","UT-ORD-135","order.models.SalesOrderShipment","barcode_model_type_code","正常系","'SS'が返却されること","なし","なし","'SS'が返却される","低",""
"136","UT-ORD-136","order.models.SalesOrderShipment","address","正常系","shipment_addressが返却されること","shipment_address=AddressA","なし","AddressAが返却される","低",""
"137","UT-ORD-137","order.models.SalesOrderShipment","address","正常系","shipment_address未設定時にorder.addressが返却されること","shipment_address=None, order.address=AddressB","なし","AddressBが返却される","低",""
"138","UT-ORD-138","order.models.SalesOrderShipment","is_checked","正常系","checked_by設定時にTrueが返却されること","checked_by=User","なし","Trueが返却される","低",""
"139","UT-ORD-139","order.models.SalesOrderShipment","is_complete","正常系","shipment_date設定時にTrueが返却されること","shipment_date=2024-01-01","なし","Trueが返却される","低",""
"140","UT-ORD-140","order.models.SalesOrderShipment","is_delivered","正常系","delivery_date設定時にTrueが返却されること","delivery_date=2024-01-05","なし","Trueが返却される","低",""
"141","UT-ORD-141","order.models.SalesOrderShipment","check_can_complete","正常系","完了可能な場合にTrueが返却されること","allocationsあり, shipment_date=None, checked or check不要","raise_error=True","Trueが返却される","中",""
"142","UT-ORD-142","order.models.SalesOrderShipment","check_can_complete","異常系","既に出荷済みでValidationErrorが発生すること","shipment_date設定済み","raise_error=True","ValidationError発生","中",""
"143","UT-ORD-143","order.models.SalesOrderShipment","check_can_complete","異常系","allocationsなしでValidationErrorが発生すること","allocations.count()=0","raise_error=True","ValidationError発生","高",""
"144","UT-ORD-144","order.models.SalesOrderShipment","check_can_complete","異常系","チェック必須で未チェック時にValidationErrorが発生すること","SALESORDER_SHIPMENT_REQUIRES_CHECK=True, checked_by=None","raise_error=True","ValidationError発生","中",""
"145","UT-ORD-145","order.models.SalesOrderShipment","complete_shipment","正常系","shipmentが完了すること","完了可能な状態","user, tracking_number, invoice_number等","shipment_date設定, バックグラウンドタスク開始","高",""
"146","UT-ORD-146","order.models.SalesOrderShipment","complete_shipment","正常系","オプションパラメータが設定されること","完了可能な状態","tracking_number='TRK001'","tracking_number='TRK001'が設定される","中",""
"147","UT-ORD-147","order.models.SalesOrderShipment","report_context","正常系","レポートコンテキストが正しく生成されること","shipmentが存在","なし","allocations, order, address, reference等を含むdictが返却される","低",""
"148","UT-ORD-148","order.models.SalesOrderAllocation","clean","異常系","item未設定時にValidationErrorが発生すること","item=None","なし","ValidationError発生","高","バリデーション"
"149","UT-ORD-149","order.models.SalesOrderAllocation","clean","異常系","line.partとitem.partが異なる場合にValidationErrorが発生すること","line.part=PartA, item.part=PartB","なし","ValidationError発生","高",""
"150","UT-ORD-150","order.models.SalesOrderAllocation","clean","異常系","quantity > item.quantityでValidationErrorが発生すること","item.quantity=5, quantity=10","なし","ValidationError発生","高","在庫数量関連"
"151","UT-ORD-151","order.models.SalesOrderAllocation","clean","異常系","過剰割当時にValidationErrorが発生すること","total_allocation > item.quantity","なし","ValidationError発生","高","在庫数量関連"
"152","UT-ORD-152","order.models.SalesOrderAllocation","clean","異常系","quantity <= 0でValidationErrorが発生すること","quantity=0","なし","ValidationError発生","高",""
"153","UT-ORD-153","order.models.SalesOrderAllocation","clean","異常系","シリアル品でquantity != 1でValidationErrorが発生すること","item.serial='SN001', quantity=2","なし","ValidationError発生","高",""
"154","UT-ORD-154","order.models.SalesOrderAllocation","clean","異常系","shipmentとline.orderが一致しない場合にValidationErrorが発生すること","line.order=OrderA, shipment.order=OrderB","なし","ValidationError発生","高","データ整合性"
"155","UT-ORD-155","order.models.SalesOrderAllocation","get_location","正常系","item.location.idが返却されること","item.location=LocationA","なし","LocationA.idが返却される","低",""
"156","UT-ORD-156","order.models.SalesOrderAllocation","get_location","境界値","location未設定時にNoneが返却されること","item.location=None","なし","Noneが返却される","低",""
"157","UT-ORD-157","order.models.SalesOrderAllocation","get_po","正常系","item.purchase_orderが返却されること","item.purchase_order=PO1","なし","PO1が返却される","低",""
"158","UT-ORD-158","order.models.SalesOrderAllocation","complete_allocation","正常系","割当が完了しstockがcustomerに移動すること","全条件満たす","user指定","allocateToCustomer呼出, line.shipped更新","高","在庫数量関連"
"159","UT-ORD-159","order.models.ReturnOrder","__str__","正常系","文字列表現が正しいフォーマットで返却されること","reference='RO-001', customer.name='Customer A'","なし","'RO-001 - Customer A'が返却される","低",""
"160","UT-ORD-160","order.models.ReturnOrder","get_absolute_url","正常系","正しいURLが返却されること","pk=789","なし","'/sales/return-order/789'を含むURLが返却される","低",""
"161","UT-ORD-161","order.models.ReturnOrder","get_api_url","正常系","API URLが返却されること","なし","なし","'api-return-order-list'のreverse URLが返却される","低",""
"162","UT-ORD-162","order.models.ReturnOrder","barcode_model_type_code","正常系","'RO'が返却されること","なし","なし","'RO'が返却される","低",""
"163","UT-ORD-163","order.models.ReturnOrder","subscribed_users","正常系","購読ユーザーリストが返却されること","line itemsにitem.partあり","なし","購読ユーザーのリストが返却される","中",""
"164","UT-ORD-164","order.models.ReturnOrder","company","正常系","customerが返却されること","customer=CompanyC","なし","CompanyCが返却される","低",""
"165","UT-ORD-165","order.models.ReturnOrder","is_pending","正常系","PENDINGステータス時にTrueが返却されること","status=PENDING","なし","Trueが返却される","低",""
"166","UT-ORD-166","order.models.ReturnOrder","is_open","正常系","OPENグループステータス時にTrueが返却されること","status=IN_PROGRESS","なし","Trueが返却される","低",""
"167","UT-ORD-167","order.models.ReturnOrder","is_received","正常系","全line items受領済みでTrueが返却されること","全line itemsでreceived_date設定済み","なし","Trueが返却される","中",""
"168","UT-ORD-168","order.models.ReturnOrder","is_received","正常系","未受領line itemありでFalseが返却されること","received_date=Noneのline itemあり","なし","Falseが返却される","中",""
"169","UT-ORD-169","order.models.ReturnOrder","can_hold","正常系","PENDING/IN_PROGRESSでTrueが返却されること","status=PENDING","なし","Trueが返却される","中",""
"170","UT-ORD-170","order.models.ReturnOrder","_action_hold","正常系","ON_HOLDステータスに遷移すること","status=PENDING","なし","status=ON_HOLDになる","中",""
"171","UT-ORD-171","order.models.ReturnOrder","can_cancel","正常系","OPENステータスでTrueが返却されること","status=IN_PROGRESS","なし","Trueが返却される","中",""
"172","UT-ORD-172","order.models.ReturnOrder","_action_cancel","正常系","CANCELLEDステータスに遷移すること","status=IN_PROGRESS","なし","status=CANCELLEDになる","中",""
"173","UT-ORD-173","order.models.ReturnOrder","_action_complete","正常系","COMPLETEステータスに遷移すること","status=IN_PROGRESS","なし","status=COMPLETE, complete_date設定","高","状態遷移"
"174","UT-ORD-174","order.models.ReturnOrder","can_issue","正常系","PENDING/ON_HOLDでTrueが返却されること","status=PENDING","なし","Trueが返却される","中",""
"175","UT-ORD-175","order.models.ReturnOrder","_action_place","正常系","IN_PROGRESSステータスに遷移すること","status=PENDING","なし","status=IN_PROGRESS, issue_date設定","高","状態遷移"
"176","UT-ORD-176","order.models.ReturnOrder","hold_order","正常系","ON_HOLDへの遷移が実行されること","status=PENDING","なし","handle_transitionが呼ばれる","中",""
"177","UT-ORD-177","order.models.ReturnOrder","issue_order","正常系","IN_PROGRESSへの遷移が実行されること","status=PENDING","なし","handle_transitionが呼ばれる","高",""
"178","UT-ORD-178","order.models.ReturnOrder","complete_order","正常系","COMPLETEへの遷移が実行されること","status=IN_PROGRESS","なし","handle_transitionが呼ばれる","高",""
"179","UT-ORD-179","order.models.ReturnOrder","cancel_order","正常系","CANCELLEDへの遷移が実行されること","status=IN_PROGRESS","なし","handle_transitionが呼ばれる","中",""
"180","UT-ORD-180","order.models.ReturnOrder","receive_line_item","正常系","line itemが受領されること","line item, location指定","user, note, status","StockItem更新, line.received_date設定","高","在庫数量関連"
"181","UT-ORD-181","order.models.ReturnOrder","receive_line_item","正常系","部分数量の場合にStockItemが分割されること","line.quantity < stock_item.quantity","user指定","StockItemが分割される","高","在庫数量関連"
"182","UT-ORD-182","order.models.ReturnOrder","receive_line_item","異常系","既に受領済みの場合に処理がスキップされること","line.received_date設定済み","user指定","処理がスキップされる","中",""
"183","UT-ORD-183","order.models.ReturnOrderLineItem","clean","異常系","item未設定時にValidationErrorが発生すること","item=None","なし","ValidationError発生","高","バリデーション"
"184","UT-ORD-184","order.models.ReturnOrderLineItem","clean","異常系","quantity > item.quantityでValidationErrorが発生すること","item.quantity=5, quantity=10","なし","ValidationError発生","高","在庫数量関連"
"185","UT-ORD-185","order.models.ReturnOrderLineItem","clean","異常系","quantity <= 0でValidationErrorが発生すること","quantity=0","なし","ValidationError発生","高",""
"186","UT-ORD-186","order.models.ReturnOrderLineItem","clean","異常系","シリアル品でquantity != 1でValidationErrorが発生すること","item.serialized=True, quantity=2","なし","ValidationError発生","高",""
"187","UT-ORD-187","order.models.ReturnOrderLineItem","received","正常系","received_date設定時にTrueが返却されること","received_date=2024-01-01","なし","Trueが返却される","低",""
"188","UT-ORD-188","order.models.ReturnOrderLineItem","received","正常系","received_date未設定時にFalseが返却されること","received_date=None","なし","Falseが返却される","低",""
"189","UT-ORD-189","order.status_codes.PurchaseOrderStatus","値定義","正常系","全ステータス値が正しく定義されていること","なし","なし","PENDING=10, PLACED=20, ON_HOLD=25, COMPLETE=30, CANCELLED=40, LOST=50, RETURNED=60","低","ステータスコード定義"
"190","UT-ORD-190","order.status_codes.PurchaseOrderStatusGroups","OPEN","正常系","OPENグループにPENDING, ON_HOLD, PLACEDが含まれること","なし","なし","[10, 25, 20]が返却される","低",""
"191","UT-ORD-191","order.status_codes.PurchaseOrderStatusGroups","FAILED","正常系","FAILEDグループにCANCELLED, LOST, RETURNEDが含まれること","なし","なし","[40, 50, 60]が返却される","低",""
"192","UT-ORD-192","order.status_codes.SalesOrderStatus","値定義","正常系","全ステータス値が正しく定義されていること","なし","なし","PENDING=10, IN_PROGRESS=15, SHIPPED=20, ON_HOLD=25, COMPLETE=30, CANCELLED=40, LOST=50, RETURNED=60","低","ステータスコード定義"
"193","UT-ORD-193","order.status_codes.SalesOrderStatusGroups","OPEN","正常系","OPENグループにPENDING, ON_HOLD, IN_PROGRESSが含まれること","なし","なし","[10, 25, 15]が返却される","低",""
"194","UT-ORD-194","order.status_codes.ReturnOrderStatus","値定義","正常系","全ステータス値が正しく定義されていること","なし","なし","PENDING=10, IN_PROGRESS=20, ON_HOLD=25, COMPLETE=30, CANCELLED=40","低","ステータスコード定義"
"195","UT-ORD-195","order.status_codes.ReturnOrderLineStatus","値定義","正常系","全ステータス値が正しく定義されていること","なし","なし","PENDING=10, RETURN=20, REPAIR=30, REPLACE=40, REFUND=50, REJECT=60","低","ステータスコード定義"
"196","UT-ORD-196","order.tasks.notify_overdue_purchase_order","","正常系","期限切れ通知が送信されること","POが存在","po=期限切れPO","通知がtriggerされイベントが発火","中","通知機能"
"197","UT-ORD-197","order.tasks.notify_overdue_purchase_order","","正常系","created_byとresponsibleに通知されること","created_by, responsible設定済み","po指定","両ユーザーに通知","中",""
"198","UT-ORD-198","order.tasks.check_overdue_purchase_orders","","正常系","昨日が期限のPOに通知が送られること","target_date=yesterday, status in OPEN","なし","notify_overdue_purchase_orderが呼ばれる","中","スケジュールタスク"
"199","UT-ORD-199","order.tasks.check_overdue_purchase_orders","","正常系","期限切れline itemsのPOにも通知が送られること","line item.target_date=yesterday","なし","notify_overdue_purchase_orderが呼ばれる","中",""
"200","UT-ORD-200","order.tasks.notify_overdue_sales_order","","正常系","期限切れ通知が送信されること","SOが存在","so=期限切れSO","通知がtriggerされイベントが発火","中","通知機能"
"201","UT-ORD-201","order.tasks.check_overdue_sales_orders","","正常系","昨日が期限のSOに通知が送られること","target_date=yesterday, status in OPEN","なし","notify_overdue_sales_orderが呼ばれる","中","スケジュールタスク"
"202","UT-ORD-202","order.tasks.notify_overdue_return_order","","正常系","期限切れ通知が送信されること","ROが存在","ro=期限切れRO","通知がtriggerされイベントが発火","中","通知機能"
"203","UT-ORD-203","order.tasks.check_overdue_return_orders","","正常系","昨日が期限のROに通知が送られること","target_date=yesterday, status in OPEN","なし","notify_overdue_return_orderが呼ばれる","中","スケジュールタスク"
"204","UT-ORD-204","order.tasks.complete_sales_order_shipment","","正常系","shipmentの全allocationsが完了すること","shipment_id存在","shipment_id, user_id","各allocationのcomplete_allocationが呼ばれる","高","バックグラウンドタスク"
"205","UT-ORD-205","order.tasks.complete_sales_order_shipment","","異常系","存在しないshipment_idで処理がスキップされること","存在しないshipment_id","shipment_id=999999","ログ出力のみで正常終了","中",""
"206","UT-ORD-206","order.validators.generate_next_sales_order_reference","","正常系","次のSO参照が生成されること","既存SO参照あり","なし","次のreference文字列が返却される","中","参照生成"
"207","UT-ORD-207","order.validators.generate_next_purchase_order_reference","","正常系","次のPO参照が生成されること","既存PO参照あり","なし","次のreference文字列が返却される","中","参照生成"
"208","UT-ORD-208","order.validators.generate_next_return_order_reference","","正常系","次のRO参照が生成されること","既存RO参照あり","なし","次のreference文字列が返却される","中","参照生成"
"209","UT-ORD-209","order.validators.validate_sales_order_reference_pattern","","正常系","有効なパターンが検証に成功すること","なし","pattern='SO-{ref:05d}'","例外が発生しない","中",""
"210","UT-ORD-210","order.validators.validate_sales_order_reference_pattern","","異常系","無効なパターンで例外が発生すること","なし","pattern='invalid'","ValidationError発生","中",""
"211","UT-ORD-211","order.validators.validate_purchase_order_reference_pattern","","正常系","有効なパターンが検証に成功すること","なし","pattern='PO-{ref:05d}'","例外が発生しない","中",""
"212","UT-ORD-212","order.validators.validate_return_order_reference_pattern","","正常系","有効なパターンが検証に成功すること","なし","pattern='RO-{ref:05d}'","例外が発生しない","中",""
"213","UT-ORD-213","order.validators.validate_sales_order_reference","","正常系","有効な参照が検証に成功すること","なし","value='SO-00001'","例外が発生しない","中",""
"214","UT-ORD-214","order.validators.validate_sales_order_reference","","異常系","無効な参照で例外が発生すること","なし","value='invalid'","ValidationError発生","中",""
"215","UT-ORD-215","order.validators.validate_purchase_order_reference","","正常系","有効な参照が検証に成功すること","なし","value='PO-00001'","例外が発生しない","中",""
"216","UT-ORD-216","order.validators.validate_return_order_reference","","正常系","有効な参照が検証に成功すること","なし","value='RO-00001'","例外が発生しない","中",""
"217","UT-ORD-217","order.events.PurchaseOrderEvents","PLACED","正常系","イベント名が正しいこと","なし","なし","'purchaseorder.placed'","低","イベント定義"
"218","UT-ORD-218","order.events.PurchaseOrderEvents","COMPLETED","正常系","イベント名が正しいこと","なし","なし","'purchaseorder.completed'","低",""
"219","UT-ORD-219","order.events.PurchaseOrderEvents","CANCELLED","正常系","イベント名が正しいこと","なし","なし","'purchaseorder.cancelled'","低",""
"220","UT-ORD-220","order.events.SalesOrderEvents","ISSUED","正常系","イベント名が正しいこと","なし","なし","'salesorder.issued'","低","イベント定義"
"221","UT-ORD-221","order.events.SalesOrderEvents","SHIPMENT_COMPLETE","正常系","イベント名が正しいこと","なし","なし","'salesordershipment.completed'","低",""
"222","UT-ORD-222","order.events.ReturnOrderEvents","ISSUED","正常系","イベント名が正しいこと","なし","なし","'returnorder.issued'","低","イベント定義"
"223","UT-ORD-223","order.events.ReturnOrderEvents","RECEIVED","正常系","イベント名が正しいこと","なし","なし","'returnorder.received'","低",""
"224","UT-ORD-224","order.models.after_save_sales_order","","正常系","デフォルトshipmentが作成されること","SALESORDER_DEFAULT_SHIPMENT=True, 新規SO作成","created=True","SalesOrderShipmentが作成される","中","シグナルハンドラ"
"225","UT-ORD-225","order.models.after_save_sales_order","","正常系","設定無効時にshipmentが作成されないこと","SALESORDER_DEFAULT_SHIPMENT=False","created=True","SalesOrderShipmentが作成されない","中",""
