"No","テストID","対象クラス","対象メソッド","テスト観点","テストケース名","前提条件","入力値","期待結果","優先度","備考"
"1","UT-STK-001","stock.models.StockLocationType","__str__","正常系","文字列表現が名前を返すこと","StockLocationTypeインスタンスが存在","name=""Warehouse""","Warehouseが返却される","低","表示用メソッド"
"2","UT-STK-002","stock.models.StockLocationType","get_api_url","正常系","APIのURLが返却されること","なし","なし","api-location-type-listのURLが返却される","低","静的メソッド"
"3","UT-STK-003","stock.models.StockLocation","delete","正常系","子ロケーションを保持して削除できること","子ロケーションが存在","delete_sub_locations=False","親ロケーションのみ削除される","高","データ整合性"
"4","UT-STK-004","stock.models.StockLocation","delete","正常系","子ロケーションも含めて削除できること","子ロケーションが存在","delete_sub_locations=True","親と子ロケーションが削除される","高","データ整合性"
"5","UT-STK-005","stock.models.StockLocation","delete","正常系","在庫アイテムを保持して削除できること","在庫アイテムが存在","delete_stock_items=False","ロケーションのみ削除される","高","データ整合性"
"6","UT-STK-006","stock.models.StockLocation","barcode_model_type_code","正常系","バーコードモデルタイプコードがSLを返すこと","なし","なし","SLが返却される","低","静的メソッド"
"7","UT-STK-007","stock.models.StockLocation","report_context","正常系","レポートコンテキストが正しく生成されること","StockLocationが存在","なし","location, qr_data, parent, stock_itemsを含むdictが返却される","中","レポート生成"
"8","UT-STK-008","stock.models.StockLocation","icon","正常系","カスタムアイコンが設定されている場合それを返すこと","custom_iconが設定済み","custom_icon=""warehouse-icon""","warehouse-iconが返却される","中","プロパティ"
"9","UT-STK-009","stock.models.StockLocation","icon","正常系","location_typeのアイコンを継承すること","custom_iconがNone, location_typeにアイコン設定あり","location_type.icon=""type-icon""","type-iconが返却される","中","プロパティ"
"10","UT-STK-010","stock.models.StockLocation","icon","正常系","グローバル設定のデフォルトアイコンを返すこと","custom_icon=None, location_type=None, グローバル設定あり","STOCK_LOCATION_DEFAULT_ICON=""default-icon""","default-iconが返却される","中","プロパティ"
"11","UT-STK-011","stock.models.StockLocation","icon","境界値","アイコンが未設定の場合空文字を返すこと","すべてのアイコン設定がなし","なし","空文字が返却される","低","プロパティ"
"12","UT-STK-012","stock.models.StockLocation","get_location_owner","正常系","自身にオーナーがある場合それを返すこと","ownerが設定済み","owner=User1","User1が返却される","中","所有権管理"
"13","UT-STK-013","stock.models.StockLocation","get_location_owner","正常系","親ロケーションのオーナーを返すこと","自身にownerなし, 親にownerあり","parent.owner=User2","User2が返却される","中","所有権管理"
"14","UT-STK-014","stock.models.StockLocation","get_location_owner","境界値","オーナーが存在しない場合Noneを返すこと","どの階層にもownerなし","なし","Noneが返却される","中","所有権管理"
"15","UT-STK-015","stock.models.StockLocation","check_ownership","正常系","スーパーユーザーは常にTrueを返すこと","user.is_superuser=True","user=superuser","Trueが返却される","高","認証・認可"
"16","UT-STK-016","stock.models.StockLocation","check_ownership","正常系","所有権管理が無効の場合Trueを返すこと","STOCK_OWNERSHIP_CONTROL=False","user=normal_user","Trueが返却される","高","認証・認可"
"17","UT-STK-017","stock.models.StockLocation","check_ownership","正常系","オーナーが許可したユーザーの場合Trueを返すこと","所有権管理有効, ユーザーが許可済み","user=allowed_user","Trueが返却される","高","認証・認可"
"18","UT-STK-018","stock.models.StockLocation","check_ownership","異常系","オーナーが許可していないユーザーの場合Falseを返すこと","所有権管理有効, ユーザーが未許可","user=not_allowed_user","Falseが返却される","高","認証・認可"
"19","UT-STK-019","stock.models.StockLocation","clean","異常系","構造的ロケーションに在庫がある場合ValidationErrorが発生すること","既存ロケーションに在庫あり","structural=True","ValidationErrorが発生","高","バリデーション"
"20","UT-STK-020","stock.models.StockLocation","clean","正常系","構造的ロケーションに在庫がない場合正常に完了すること","既存ロケーションに在庫なし","structural=True","エラーなし","中","バリデーション"
"21","UT-STK-021","stock.models.StockLocation","get_stock_items","正常系","カスケードなしで直接の在庫アイテムのみ取得できること","子ロケーションに在庫あり","cascade=False","直接の在庫アイテムのみ返却","中","クエリ"
"22","UT-STK-022","stock.models.StockLocation","get_stock_items","正常系","カスケードありで子ロケーションの在庫も取得できること","子ロケーションに在庫あり","cascade=True","すべての在庫アイテムが返却","中","クエリ"
"23","UT-STK-023","stock.models.StockLocation","stock_item_count","正常系","在庫アイテム数が正しく計算されること","複数の在庫アイテムが存在","cascade=True","正しいカウントが返却される","中","集計"
"24","UT-STK-024","stock.models.StockLocation","item_count","正常系","プロパティが在庫アイテム数を返すこと","在庫アイテムが存在","なし","stock_item_count()と同じ値が返却","低","プロパティ"
"25","UT-STK-025","stock.models.StockItem","convert_serial_to_int","正常系","数値文字列が整数に変換されること","なし","serial=""123""","123が返却される","中","シリアル番号変換"
"26","UT-STK-026","stock.models.StockItem","convert_serial_to_int","境界値","空文字の場合Noneを返すこと","なし","serial=""""","Noneが返却される","中","シリアル番号変換"
"27","UT-STK-027","stock.models.StockItem","convert_serial_to_int","境界値","Noneの場合Noneを返すこと","なし","serial=None","Noneが返却される","中","シリアル番号変換"
"28","UT-STK-028","stock.models.StockItem","convert_serial_to_int","境界値","最大値を超える場合クリップされること","なし","serial=""999999999999""","0x7FFFFFFFが返却される","中","シリアル番号変換"
"29","UT-STK-029","stock.models.StockItem","update_serial_number","正常系","シリアル番号が整数表現に更新されること","serial=""456""","なし","serial_int=456に更新される","中","シリアル番号更新"
"30","UT-STK-030","stock.models.StockItem","update_serial_number","境界値","空のシリアル番号の場合serial_intが0になること","serial=""""","なし","serial_int=0に更新される","中","シリアル番号更新"
"31","UT-STK-031","stock.models.StockItem","get_next_serialized_item","正常系","次のシリアル番号のアイテムが取得できること","連続するシリアル番号のアイテムが存在","reverse=False","次のシリアル番号のアイテムが返却","中","シリアル番号検索"
"32","UT-STK-032","stock.models.StockItem","get_next_serialized_item","正常系","前のシリアル番号のアイテムが取得できること","連続するシリアル番号のアイテムが存在","reverse=True","前のシリアル番号のアイテムが返却","中","シリアル番号検索"
"33","UT-STK-033","stock.models.StockItem","get_next_serialized_item","境界値","シリアル化されていない場合Noneを返すこと","serialized=False","なし","Noneが返却される","中","シリアル番号検索"
"34","UT-STK-034","stock.models.StockItem","serialized","正常系","シリアル番号と数量1の場合Trueを返すこと","serial=""001"", quantity=1","なし","Trueが返却される","高","プロパティ"
"35","UT-STK-035","stock.models.StockItem","serialized","異常系","シリアル番号がNoneの場合Falseを返すこと","serial=None, quantity=1","なし","Falseが返却される","高","プロパティ"
"36","UT-STK-036","stock.models.StockItem","serialized","異常系","数量が1以外の場合Falseを返すこと","serial=""001"", quantity=5","なし","Falseが返却される","高","プロパティ"
"37","UT-STK-037","stock.models.StockItem","validate_unique","正常系","一意のシリアル番号が許可されること","同じパーツに同じシリアルなし","serial=""UNIQUE-001""","エラーなし","高","バリデーション"
"38","UT-STK-038","stock.models.StockItem","validate_unique","異常系","重複するシリアル番号でValidationErrorが発生すること","同じパーツに同じシリアルあり","serial=""DUPLICATE""","ValidationErrorが発生","高","バリデーション"
"39","UT-STK-039","stock.models.StockItem","validate_batch_code","正常系","有効なバッチコードが許可されること","プラグインでバリデーション設定なし","batch=""BATCH-001""","エラーなし","中","バリデーション"
"40","UT-STK-040","stock.models.StockItem","clean","異常系","構造的ロケーションに配置しようとした場合ValidationErrorが発生すること","location.structural=True","location=structural_location","ValidationErrorが発生","高","バリデーション"
"41","UT-STK-041","stock.models.StockItem","clean","異常系","仮想パーツに在庫を作成しようとした場合ValidationErrorが発生すること","part.virtual=True","part=virtual_part","ValidationErrorが発生","高","バリデーション"
"42","UT-STK-042","stock.models.StockItem","clean","異常系","負の数量でValidationErrorが発生すること","なし","quantity=-1","ValidationErrorが発生","高","バリデーション"
"43","UT-STK-043","stock.models.StockItem","clean","異常系","シリアル番号付きで数量が1より大きい場合ValidationErrorが発生すること","serial=""001""","quantity=5","ValidationErrorが発生","高","バリデーション"
"44","UT-STK-044","stock.models.StockItem","clean","異常系","自分自身に属する設定でValidationErrorが発生すること","なし","belongs_to=self","ValidationErrorが発生","高","バリデーション"
"45","UT-STK-045","stock.models.StockItem","clean","異常系","is_building=TrueでビルドなしのValidationErrorが発生すること","build=None","is_building=True","ValidationErrorが発生","高","バリデーション"
"46","UT-STK-046","stock.models.StockItem","clean","正常系","トラッカブルパーツの整数数量が許可されること","part.trackable=True","quantity=10","エラーなし","中","バリデーション"
"47","UT-STK-047","stock.models.StockItem","clean","異常系","トラッカブルパーツの小数数量でValidationErrorが発生すること","part.trackable=True","quantity=10.5","ValidationErrorが発生","高","バリデーション"
"48","UT-STK-048","stock.models.StockItem","save","正常系","新規作成時にトラッキングエントリが追加されること","新規StockItem","add_note=True","CREATEDトラッキングエントリが作成される","中","保存処理"
"49","UT-STK-049","stock.models.StockItem","save","正常系","ステータス変更時にトラッキングエントリが追加されること","既存StockItem","status変更","EDITEDトラッキングエントリが作成される","中","保存処理"
"50","UT-STK-050","stock.models.StockItem","convert_to_variant","正常系","バリアントへの変換が正常に行われること","StockItemが存在","variant=new_variant","partが更新され、トラッキングエントリが追加される","中","バリアント変換"
"51","UT-STK-051","stock.models.StockItem","convert_to_variant","境界値","Noneバリアントの場合何もしないこと","StockItemが存在","variant=None","変更なし","低","バリアント変換"
"52","UT-STK-052","stock.models.StockItem","convert_to_variant","境界値","同じパーツの場合何もしないこと","StockItemが存在","variant=current_part","変更なし","低","バリアント変換"
"53","UT-STK-053","stock.models.StockItem","get_item_owner","正常系","アイテムのオーナーが返却されること","owner設定あり","なし","オーナーが返却される","中","所有権管理"
"54","UT-STK-054","stock.models.StockItem","get_item_owner","正常系","ロケーションのオーナーが返却されること","アイテムにownerなし, ロケーションにownerあり","なし","ロケーションのオーナーが返却される","中","所有権管理"
"55","UT-STK-055","stock.models.StockItem","check_ownership","正常系","スーパーユーザーは常にTrueを返すこと","user.is_superuser=True","user=superuser","Trueが返却される","高","認証・認可"
"56","UT-STK-056","stock.models.StockItem","is_stale","正常系","期限切れ間近の場合Trueを返すこと","expiry_date設定, STOCK_STALE_DAYS内","expiry_date=近い将来","Trueが返却される","中","期限管理"
"57","UT-STK-057","stock.models.StockItem","is_stale","正常系","期限が十分先の場合Falseを返すこと","expiry_date設定, STOCK_STALE_DAYS外","expiry_date=十分先","Falseが返却される","中","期限管理"
"58","UT-STK-058","stock.models.StockItem","is_stale","境界値","expiry_dateがNoneの場合Falseを返すこと","expiry_date=None","なし","Falseが返却される","中","期限管理"
"59","UT-STK-059","stock.models.StockItem","is_expired","正常系","期限切れの場合Trueを返すこと","expiry_date設定, 過去日付","expiry_date=過去","Trueが返却される","中","期限管理"
"60","UT-STK-060","stock.models.StockItem","is_expired","正常系","期限内の場合Falseを返すこと","expiry_date設定, 未来日付","expiry_date=未来","Falseが返却される","中","期限管理"
"61","UT-STK-061","stock.models.StockItem","is_expired","境界値","expiry_dateがNoneの場合Falseを返すこと","expiry_date=None","なし","Falseが返却される","中","期限管理"
"62","UT-STK-062","stock.models.StockItem","clearAllocations","正常系","すべてのアロケーションが削除されること","SalesOrderとBuildOrderのアロケーションが存在","なし","アロケーションが全削除される","高","アロケーション管理"
"63","UT-STK-063","stock.models.StockItem","allocateToCustomer","正常系","全数量が顧客に割り当てられること","quantity=10","customer=customer1, quantity=None","全量が顧客に割り当てられる","高","顧客割り当て"
"64","UT-STK-064","stock.models.StockItem","allocateToCustomer","正常系","一部数量が顧客に割り当てられること","quantity=10","customer=customer1, quantity=5","5個が分割され顧客に割り当てられる","高","顧客割り当て"
"65","UT-STK-065","stock.models.StockItem","return_from_customer","正常系","顧客から在庫に返却されること","customerに割り当て済み","location=warehouse","在庫に返却される","高","返却処理"
"66","UT-STK-066","stock.models.StockItem","return_to_stock","正常系","在庫に返却されること","消費済み状態","location=warehouse","在庫に返却される","高","返却処理"
"67","UT-STK-067","stock.models.StockItem","return_to_stock","異常系","数量0以下でValidationErrorが発生すること","なし","quantity=0","ValidationErrorが発生","高","返却処理"
"68","UT-STK-068","stock.models.StockItem","return_to_stock","異常系","数量超過でValidationErrorが発生すること","quantity=10","quantity=20","ValidationErrorが発生","高","返却処理"
"69","UT-STK-069","stock.models.StockItem","is_allocated","正常系","アロケーションがある場合Trueを返すこと","アロケーションあり","なし","Trueが返却される","中","アロケーション確認"
"70","UT-STK-070","stock.models.StockItem","is_allocated","正常系","アロケーションがない場合Falseを返すこと","アロケーションなし","なし","Falseが返却される","中","アロケーション確認"
"71","UT-STK-071","stock.models.StockItem","build_allocation_count","正常系","ビルドアロケーション数が正しく計算されること","ビルドアロケーションあり","なし","正しいカウントが返却される","高","アロケーション集計"
"72","UT-STK-072","stock.models.StockItem","sales_order_allocation_count","正常系","販売注文アロケーション数が正しく計算されること","販売注文アロケーションあり","active=True","正しいカウントが返却される","高","アロケーション集計"
"73","UT-STK-073","stock.models.StockItem","allocation_count","正常系","総アロケーション数が正しく計算されること","両方のアロケーションあり","なし","build + sales_orderの合計が返却される","高","アロケーション集計"
"74","UT-STK-074","stock.models.StockItem","unallocated_quantity","正常系","未アロケーション数量が正しく計算されること","quantity=10, allocated=3","なし","7が返却される","高","数量計算"
"75","UT-STK-075","stock.models.StockItem","unallocated_quantity","境界値","アロケーション超過の場合0を返すこと","quantity=10, allocated=15","なし","0が返却される","中","数量計算"
"76","UT-STK-076","stock.models.StockItem","can_delete","正常系","削除可能な場合Trueを返すこと","インストール済みアイテムなし, sales_order=None","なし","Trueが返却される","中","削除可否判定"
"77","UT-STK-077","stock.models.StockItem","can_delete","異常系","インストール済みアイテムがある場合Falseを返すこと","installed_item_count > 0","なし","Falseが返却される","中","削除可否判定"
"78","UT-STK-078","stock.models.StockItem","can_delete","異常系","販売注文に割り当て済みの場合Falseを返すこと","sales_order設定あり","なし","Falseが返却される","中","削除可否判定"
"79","UT-STK-079","stock.models.StockItem","get_installed_items","正常系","インストール済みアイテムが取得できること","belongs_toで関連するアイテムあり","cascade=False","直接のインストール済みアイテムが返却","中","インストール管理"
"80","UT-STK-080","stock.models.StockItem","get_installed_items","正常系","カスケードでネストしたアイテムも取得できること","ネストしたインストールあり","cascade=True","すべてのインストール済みアイテムが返却","中","インストール管理"
"81","UT-STK-081","stock.models.StockItem","installStockItem","正常系","他のアイテムをインストールできること","インストール対象アイテムが存在","other_item, quantity=5","アイテムがインストールされる","高","インストール処理"
"82","UT-STK-082","stock.models.StockItem","uninstall_into_location","正常系","アイテムをアンインストールしてロケーションに移動できること","インストール済み状態","location=warehouse","アンインストールされロケーションに移動","高","アンインストール処理"
"83","UT-STK-083","stock.models.StockItem","uninstall_into_location","境界値","belongs_toがNoneの場合Falseを返すこと","belongs_to=None","なし","Falseが返却される","中","アンインストール処理"
"84","UT-STK-084","stock.models.StockItem","is_in_stock","正常系","在庫中の場合Trueを返すこと","正常な在庫状態","check_status=True","Trueが返却される","高","在庫状態確認"
"85","UT-STK-085","stock.models.StockItem","is_in_stock","異常系","ステータスがAVAILABLE_CODES外の場合Falseを返すこと","status=DESTROYED","check_status=True","Falseが返却される","高","在庫状態確認"
"86","UT-STK-086","stock.models.StockItem","is_in_stock","異常系","数量が0以下の場合Falseを返すこと","quantity=0","check_quantity=True","Falseが返却される","高","在庫状態確認"
"87","UT-STK-087","stock.models.StockItem","is_in_stock","異常系","製造中の場合Falseを返すこと","is_building=True","check_in_production=True","Falseが返却される","高","在庫状態確認"
"88","UT-STK-088","stock.models.StockItem","is_in_stock","異常系","販売注文に割り当て済みの場合Falseを返すこと","sales_order設定あり","なし","Falseが返却される","高","在庫状態確認"
"89","UT-STK-089","stock.models.StockItem","in_stock","正常系","プロパティがis_in_stockを返すこと","正常な在庫状態","なし","is_in_stock(check_status=True)と同じ値","中","プロパティ"
"90","UT-STK-090","stock.models.StockItem","can_adjust_location","正常系","ロケーション調整可能な場合Trueを返すこと","customer=None, belongs_to=None, sales_order=None","なし","Trueが返却される","中","ロケーション調整"
"91","UT-STK-091","stock.models.StockItem","can_adjust_location","異常系","customerがある場合Falseを返すこと","customer設定あり","なし","Falseが返却される","中","ロケーション調整"
"92","UT-STK-092","stock.models.StockItem","add_tracking_entry","正常系","トラッキングエントリが追加されること","StockItemが存在","entry_type=STOCK_ADD, user=user1","StockItemTrackingが作成される","中","トラッキング"
"93","UT-STK-093","stock.models.StockItem","add_tracking_entry","境界値","STOCK_UPDATEでdeltasが空の場合Noneを返すこと","なし","entry_type=STOCK_UPDATE, deltas={}, notes=""""","Noneが返却される","低","トラッキング"
"94","UT-STK-094","stock.models.StockItem","serializeStock","正常系","在庫をシリアル化できること","trackableパーツ, quantity=10","quantity=3, serials=[""001"",""002"",""003""]","3つのシリアル化されたStockItemが作成される","高","シリアル化"
"95","UT-STK-095","stock.models.StockItem","serializeStock","異常系","既にシリアル化済みの場合Noneを返すこと","serialized=True","なし","Noneが返却される","中","シリアル化"
"96","UT-STK-096","stock.models.StockItem","serializeStock","異常系","trackableでない場合ValidationErrorが発生すること","part.trackable=False","なし","ValidationErrorが発生","高","シリアル化"
"97","UT-STK-097","stock.models.StockItem","serializeStock","異常系","数量が0以下の場合ValidationErrorが発生すること","なし","quantity=0","ValidationErrorが発生","高","シリアル化"
"98","UT-STK-098","stock.models.StockItem","serializeStock","異常系","数量超過の場合ValidationErrorが発生すること","quantity=10","quantity=20","ValidationErrorが発生","高","シリアル化"
"99","UT-STK-099","stock.models.StockItem","serializeStock","異常系","重複シリアル番号でValidationErrorが発生すること","既存シリアルあり","serials含む既存シリアル","ValidationErrorが発生","高","シリアル化"
"100","UT-STK-100","stock.models.StockItem","copyTestResultsFrom","正常系","テスト結果がコピーされること","元アイテムにテスト結果あり","other=source_item","テスト結果がコピーされる","中","テスト結果コピー"
"101","UT-STK-101","stock.models.StockItem","add_test_result","正常系","テスト結果が追加されること","なし","test_name=""Test1"", result=True","StockItemTestResultが作成される","中","テスト結果追加"
"102","UT-STK-102","stock.models.StockItem","add_test_result","正常系","テンプレートが存在しない場合作成されること","テンプレートなし","test_name=""NewTest"", create_template=True","テンプレートとテスト結果が作成される","中","テスト結果追加"
"103","UT-STK-103","stock.models.StockItem","add_test_result","異常系","テンプレートなしでcreate_template=Falseの場合ValidationErrorが発生すること","テンプレートなし","create_template=False","ValidationErrorが発生","中","テスト結果追加"
"104","UT-STK-104","stock.models.StockItem","can_merge","正常系","マージ可能な場合Trueを返すこと","同じパーツ, 同じステータス, シリアルなし","other=compatible_item","Trueが返却される","中","マージ可否判定"
"105","UT-STK-105","stock.models.StockItem","can_merge","異常系","販売注文に割り当て済みの場合Falseを返すこと","sales_order設定あり","なし","Falseが返却される","中","マージ可否判定"
"106","UT-STK-106","stock.models.StockItem","can_merge","異常系","インストール済みの場合Falseを返すこと","belongs_to設定あり","なし","Falseが返却される","中","マージ可否判定"
"107","UT-STK-107","stock.models.StockItem","can_merge","異常系","シリアル化されている場合Falseを返すこと","serialized=True","なし","Falseが返却される","中","マージ可否判定"
"108","UT-STK-108","stock.models.StockItem","can_merge","異常系","異なるパーツの場合Falseを返すこと","なし","other.part != self.part","Falseが返却される","中","マージ可否判定"
"109","UT-STK-109","stock.models.StockItem","merge_stock_items","正常系","在庫アイテムがマージされること","マージ可能なアイテム","other_items=[item1, item2]","数量が合計され、他は削除される","高","マージ処理"
"110","UT-STK-110","stock.models.StockItem","merge_stock_items","正常系","価格が加重平均で計算されること","異なる価格のアイテム","price情報あり","加重平均価格が設定される","高","マージ処理"
"111","UT-STK-111","stock.models.StockItem","splitStock","正常系","在庫が分割されること","quantity=10","quantity=3","3個の新しいStockItemが作成される","高","分割処理"
"112","UT-STK-112","stock.models.StockItem","splitStock","境界値","シリアル化されている場合selfを返すこと","serialized=True","なし","selfが返却される","中","分割処理"
"113","UT-STK-113","stock.models.StockItem","splitStock","境界値","数量0以下の場合selfを返すこと","なし","quantity=0","selfが返却される","中","分割処理"
"114","UT-STK-114","stock.models.StockItem","splitStock","境界値","全量以上の場合selfを返すこと","quantity=10","quantity=15","selfが返却される","中","分割処理"
"115","UT-STK-115","stock.models.StockItem","splitStock","異常系","製造中の場合ValidationErrorが発生すること","is_building=True","allow_production=False","ValidationErrorが発生","高","分割処理"
"116","UT-STK-116","stock.models.StockItem","move","正常系","在庫がロケーションに移動されること","location=location1","location=location2","ロケーションが更新され、トラッキングが追加される","高","移動処理"
"117","UT-STK-117","stock.models.StockItem","move","正常系","一部数量のみ移動されること","quantity=10","quantity=5, location=location2","5個が分割され移動される","高","移動処理"
"118","UT-STK-118","stock.models.StockItem","move","境界値","数量0以下の場合Falseを返すこと","なし","quantity=0","Falseが返却される","中","移動処理"
"119","UT-STK-119","stock.models.StockItem","move","境界値","ロケーションがNoneの場合Falseを返すこと","なし","location=None","Falseが返却される","中","移動処理"
"120","UT-STK-120","stock.models.StockItem","move","異常系","在庫外で転送不可の場合ValidationErrorが発生すること","in_stock=False, STOCK_ALLOW_OUT_OF_STOCK_TRANSFER=False","なし","ValidationErrorが発生","高","移動処理"
"121","UT-STK-121","stock.models.StockItem","updateQuantity","正常系","数量が更新されること","quantity=10","quantity=15","数量が15に更新される","高","数量更新"
"122","UT-STK-122","stock.models.StockItem","updateQuantity","正常系","数量0でdelete_on_depleteの場合削除されること","delete_on_deplete=True","quantity=0","StockItemが削除される","高","数量更新"
"123","UT-STK-123","stock.models.StockItem","updateQuantity","境界値","シリアル化されている場合何もしないこと","serialized=True","quantity=5","変更なし","中","数量更新"
"124","UT-STK-124","stock.models.StockItem","stocktake","正常系","棚卸しが実行されること","quantity=10","count=8","数量が8に更新、棚卸し日時が記録される","高","棚卸し"
"125","UT-STK-125","stock.models.StockItem","stocktake","異常系","負の数量でFalseを返すこと","なし","count=-5","Falseが返却される","高","棚卸し"
"126","UT-STK-126","stock.models.StockItem","add_stock","正常系","在庫が追加されること","quantity=10","quantity=5","数量が15に更新される","高","在庫追加"
"127","UT-STK-127","stock.models.StockItem","add_stock","異常系","シリアル化されている場合Falseを返すこと","serialized=True","quantity=5","Falseが返却される","高","在庫追加"
"128","UT-STK-128","stock.models.StockItem","add_stock","境界値","数量0以下の場合Falseを返すこと","なし","quantity=0","Falseが返却される","中","在庫追加"
"129","UT-STK-129","stock.models.StockItem","take_stock","正常系","在庫が減少すること","quantity=10","quantity=3","数量が7に更新される","高","在庫削減"
"130","UT-STK-130","stock.models.StockItem","take_stock","異常系","シリアル化されている場合Falseを返すこと","serialized=True","quantity=1","Falseが返却される","高","在庫削減"
"131","UT-STK-131","stock.models.StockItem","take_stock","境界値","数量0以下の場合Falseを返すこと","なし","quantity=0","Falseが返却される","中","在庫削減"
"132","UT-STK-132","stock.models.StockItem","__str__","正常系","trackableパーツでシリアル番号ありの場合正しい文字列を返すこと","part.trackable=True, serial=""001""","なし","Part #001形式の文字列が返却される","低","表示用メソッド"
"133","UT-STK-133","stock.models.StockItem","__str__","正常系","通常パーツの場合数量と名前を返すこと","quantity=5","なし","5 x PartName形式の文字列が返却される","低","表示用メソッド"
"134","UT-STK-134","stock.models.StockItem","getTestResults","正常系","テスト結果が取得できること","テスト結果あり","なし","テスト結果のQuerySetが返却される","中","テスト結果取得"
"135","UT-STK-135","stock.models.StockItem","getTestResults","正常系","テンプレートでフィルタできること","複数テスト結果あり","template=specific_template","フィルタされた結果が返却される","中","テスト結果取得"
"136","UT-STK-136","stock.models.StockItem","testResultMap","正常系","テスト結果のマップが取得できること","複数テスト結果あり","なし","key: resultのdictが返却される","中","テスト結果マップ"
"137","UT-STK-137","stock.models.StockItem","requiredTestStatus","正常系","必須テストのステータスが取得できること","必須テストあり","なし","total, passed, failedを含むdictが返却される","中","テストステータス"
"138","UT-STK-138","stock.models.StockItem","passedAllRequiredTests","正常系","すべての必須テストに合格した場合Trueを返すこと","すべて合格","なし","Trueが返却される","中","テスト合格判定"
"139","UT-STK-139","stock.models.StockItem","passedAllRequiredTests","異常系","未合格テストがある場合Falseを返すこと","一部不合格","なし","Falseが返却される","中","テスト合格判定"
"140","UT-STK-140","stock.models.StockItemTracking","label","正常系","tracking_typeに対応するラベルが返却されること","tracking_type=STOCK_ADD","なし","Stock manually addedが返却される","低","ラベル取得"
"141","UT-STK-141","stock.models.StockItemTracking","get_api_url","正常系","APIのURLが返却されること","なし","なし","api-stock-tracking-listのURLが返却される","低","静的メソッド"
"142","UT-STK-142","stock.models.StockItemTestResult","__str__","正常系","文字列表現がテスト名と結果を含むこと","test_name=""Test1"", result=True","なし","Test1 - True形式の文字列が返却される","低","表示用メソッド"
"143","UT-STK-143","stock.models.StockItemTestResult","clean","異常系","テンプレートがない場合ValidationErrorが発生すること","template=None","なし","ValidationErrorが発生","高","バリデーション"
"144","UT-STK-144","stock.models.StockItemTestResult","clean","異常系","値が必須で未入力の場合ValidationErrorが発生すること","template.requires_value=True","value=""""","ValidationErrorが発生","高","バリデーション"
"145","UT-STK-145","stock.models.StockItemTestResult","clean","異常系","添付ファイルが必須で未添付の場合ValidationErrorが発生すること","template.requires_attachment=True","attachment=None","ValidationErrorが発生","高","バリデーション"
"146","UT-STK-146","stock.models.StockItemTestResult","clean","異常系","選択肢外の値でValidationErrorが発生すること","template.choices設定あり","value=invalid_choice","ValidationErrorが発生","高","バリデーション"
"147","UT-STK-147","stock.models.StockItemTestResult","key","正常系","テスト名からキーが生成されること","test_name=""My Test Name""","なし","my_test_name形式のキーが返却される","低","キー生成"
"148","UT-STK-148","stock.generators.generate_batch_code","","正常系","バッチコードが生成されること","STOCK_BATCH_CODE_TEMPLATE設定あり","なし","テンプレートに基づくバッチコードが返却される","中","バッチコード生成"
"149","UT-STK-149","stock.generators.generate_batch_code","","正常系","プラグインからバッチコードが生成されること","プラグイン設定あり","なし","プラグインが生成したバッチコードが返却される","中","バッチコード生成"
"150","UT-STK-150","stock.generators.generate_serial_number","","正常系","シリアル番号が生成されること","パーツが存在","part=part1, quantity=3","カンマ区切りの3つのシリアル番号が返却される","中","シリアル番号生成"
"151","UT-STK-151","stock.generators.generate_serial_number","","境界値","パーツがNoneの場合Noneを返すこと","なし","part=None","Noneが返却される","中","シリアル番号生成"
"152","UT-STK-152","stock.generators.generate_serial_number","","異常系","数量が1未満の場合ValidationErrorが発生すること","なし","quantity=0","ValidationErrorが発生","中","シリアル番号生成"
"153","UT-STK-153","stock.tasks.rebuild_stock_items","","正常系","StockItemツリーが再構築されること","なし","なし","StockItem.objects.rebuild()が呼ばれる","中","ツリー再構築"
"154","UT-STK-154","stock.tasks.rebuild_stock_item_tree","","正常系","特定のツリーIDで部分再構築が成功すること","tree_id存在","tree_id=1","Trueが返却される","中","ツリー再構築"
"155","UT-STK-155","stock.tasks.rebuild_stock_item_tree","","正常系","tree_idがNoneの場合全体再構築すること","なし","tree_id=None","全体再構築が実行される","中","ツリー再構築"
"156","UT-STK-156","stock.tasks.rebuild_stock_item_tree","","異常系","部分再構築失敗時に全体再構築がスケジュールされること","再構築エラー","rebuild_on_fail=True","offload_taskが呼ばれ、Falseが返却される","中","ツリー再構築"
"157","UT-STK-157","stock.status_codes.StockStatus","","正常系","OKステータスの値が10であること","なし","StockStatus.OK.value","10が返却される","低","ステータスコード"
"158","UT-STK-158","stock.status_codes.StockStatusGroups","","正常系","AVAILABLE_CODESに正しいステータスが含まれること","なし","StockStatusGroups.AVAILABLE_CODES","OK, ATTENTION, DAMAGED, RETURNEDの値が含まれる","中","ステータスグループ"
"159","UT-STK-159","stock.events.StockEvents","","正常系","イベント列挙値が正しいこと","なし","StockEvents.ITEM_MOVED","stockitem.movedが返却される","低","イベント定義"
"160","UT-STK-160","stock.filters.annotate_location_items","","正常系","ロケーションのアイテム数アノテーションが正しく機能すること","サブロケーションにアイテムあり","filter=None","正しいカウントがアノテーションされる","中","フィルタ"
"161","UT-STK-161","stock.filters.annotate_sub_locations","","正常系","サブロケーション数アノテーションが正しく機能すること","サブロケーションあり","なし","正しいサブロケーション数がアノテーションされる","中","フィルタ"
"162","UT-STK-162","stock.models.default_delete_on_deplete","","正常系","グローバル設定の値が返却されること","STOCK_DELETE_DEPLETED_DEFAULT=True","なし","Trueが返却される","中","デフォルト値"
"163","UT-STK-163","stock.models.default_delete_on_deplete","","異常系","データベースエラー時にTrueを返すこと","IntegrityError発生","なし","Trueが返却される","低","デフォルト値"
"164","UT-STK-164","stock.models.StockItem","_create_serial_numbers","正常系","複数のシリアル番号付きStockItemが一括作成されること","なし","serials=[""001"",""002"",""003""], part=part1","3つのStockItemが作成される","高","一括作成"
"165","UT-STK-165","stock.models.StockItem","_create_serial_numbers","異常系","パーツがない場合ValidationErrorが発生すること","なし","part未指定","ValidationErrorが発生","高","一括作成"
"166","UT-STK-166","stock.models.StockItem","barcode_model_type_code","正常系","バーコードモデルタイプコードがSIを返すこと","なし","なし","SIが返却される","低","静的メソッド"
"167","UT-STK-167","stock.models.StockItem","status_label","正常系","ステータスラベルが返却されること","status=StockStatus.OK","なし","OKが返却される","低","プロパティ"
"168","UT-STK-168","stock.models.StockItem","status_text","正常系","ステータステキストが返却されること","status=StockStatus.OK","なし","OKのテキストが返却される","低","プロパティ"
