"No","テストID","対象クラス","対象メソッド","テスト観点","テストケース名","前提条件","入力値","期待結果","優先度","備考"
"1","UT-COM-001","company.models.Company","__str__","正常系","企業名と説明が正しく連結されること","Companyインスタンスが存在","name=""TestCo"", description=""A test company""","TestCo - A test companyが返却される","低","文字列表現"
"2","UT-COM-002","company.models.Company","get_api_url","正常系","API URLが正しく返却されること","なし","なし","api-company-listのURLが返却される","低","静的メソッド"
"3","UT-COM-003","company.models.Company","report_context","正常系","レポートコンテキストが正しく生成されること","Companyインスタンスが存在","company, name, description, website, phone, email","辞書形式のコンテキストが返却される","中","レポート機能"
"4","UT-COM-004","company.models.Company","address","正常系","プライマリアドレスの文字列が返却されること","Companyにプライマリアドレスが設定済み","なし","プライマリアドレスの文字列表現が返却される","中","後方互換性プロパティ"
"5","UT-COM-005","company.models.Company","address","異常系","プライマリアドレスがない場合Noneが返却されること","Companyにアドレスが未設定","なし","Noneが返却される","中","後方互換性プロパティ"
"6","UT-COM-006","company.models.Company","primary_address","正常系","プライマリアドレスオブジェクトが返却されること","Companyにprimary=Trueのアドレスが存在","なし","Addressオブジェクトが返却される","中","プロパティ"
"7","UT-COM-007","company.models.Company","primary_address","正常系","プリフェッチされたアドレスリストから取得できること","primary_address_list属性が存在","なし","リストの最初の要素が返却される","中","パフォーマンス最適化"
"8","UT-COM-008","company.models.Company","primary_address","境界値","プリフェッチリストが空の場合Noneが返却されること","primary_address_list=[]","なし","Noneが返却される","中","境界値テスト"
"9","UT-COM-009","company.models.Company","currency_code","正常系","設定された通貨コードが返却されること","currency=""USD""","なし","USDが返却される","高","通貨処理"
"10","UT-COM-010","company.models.Company","currency_code","異常系","無効な通貨コードの場合デフォルト通貨が返却されること","currency=""INVALID""","なし","デフォルト通貨コードが返却される","高","通貨バリデーション"
"11","UT-COM-011","company.models.Company","currency_code","境界値","空の通貨コードの場合デフォルト通貨が返却されること","currency=""""","なし","デフォルト通貨コードが返却される","高","通貨バリデーション"
"12","UT-COM-012","company.models.Company","parts","正常系","サプライヤーまたは製造業者のパーツが返却されること","関連するSupplierPartが存在","なし","SupplierPartのQuerySetが返却される","中","リレーションプロパティ"
"13","UT-COM-013","company.models.Company","parts","境界値","関連パーツがない場合空のQuerySetが返却されること","関連するSupplierPartが存在しない","なし","空のQuerySetが返却される","中","リレーションプロパティ"
"14","UT-COM-014","company.models.Company","stock_items","正常系","関連する在庫アイテムが返却されること","関連するStockItemが存在","なし","StockItemのQuerySetが返却される","中","リレーションプロパティ"
"15","UT-COM-015","company.models.Company","get_absolute_url","正常系","詳細ビューのURLが返却されること","Companyインスタンスが存在","pk=1","/purchasing/manufacturer/1を含むURLが返却される","低","URLプロパティ"
"16","UT-COM-016","company.models.Contact","get_api_url","正常系","Contact API URLが正しく返却されること","なし","なし","api-contact-listのURLが返却される","低","静的メソッド"
"17","UT-COM-017","company.models.Contact","company","正常系","関連するCompanyが取得できること","Contactが会社に関連付け済み","なし","Companyオブジェクトが返却される","中","ForeignKeyリレーション"
"18","UT-COM-018","company.models.Address","__str__","正常系","住所の文字列表現が正しく生成されること","すべてのフィールドに値がある","line1, line2, postal_code, postal_city, province, country","カンマ区切りの住所文字列が返却される","低","文字列表現"
"19","UT-COM-019","company.models.Address","__str__","境界値","空のフィールドが除外されること","一部フィールドのみに値がある","line1=""123 Main St"", country=""USA"", 他は空","123 Main St, USAが返却される","低","文字列表現"
"20","UT-COM-020","company.models.Address","save","正常系","最初のアドレスが自動的にプライマリになること","Companyにアドレスが存在しない","primary=False","primary=Trueで保存される","高","データ整合性"
"21","UT-COM-021","company.models.Address","save","正常系","プライマリ設定時に他のアドレスがnon-primaryになること","Companyに既存のプライマリアドレスが存在","primary=True","既存アドレスのprimary=Falseになる","高","データ整合性"
"22","UT-COM-022","company.models.Address","save","正常系","複数アドレスで新規プライマリ設定時の排他制御","複数のアドレスが存在","新しいアドレスでprimary=True","1つのみがprimary=Trueになる","高","データ整合性"
"23","UT-COM-023","company.models.Address","get_api_url","正常系","Address API URLが正しく返却されること","なし","なし","api-address-listのURLが返却される","低","静的メソッド"
"24","UT-COM-024","company.models.ManufacturerPart","get_api_url","正常系","ManufacturerPart API URLが正しく返却されること","なし","なし","api-manufacturer-part-listのURLが返却される","低","静的メソッド"
"25","UT-COM-025","company.models.ManufacturerPart","barcode_model_type_code","正常系","バーコードタイプコードMPが返却されること","なし","なし","MPが返却される","低","クラスメソッド"
"26","UT-COM-026","company.models.ManufacturerPart","create","正常系","新規ManufacturerPartが作成されること","同一のpart, manufacturer, MPNの組み合わせが存在しない","part, manufacturer, mpn, description","新しいManufacturerPartが作成される","高","ファクトリメソッド"
"27","UT-COM-027","company.models.ManufacturerPart","create","正常系","既存のManufacturerPartがある場合は既存を返却すること","同一のpart, manufacturer, MPNの組み合わせが存在","part, manufacturer, mpn, description","既存のManufacturerPartが返却される","高","ファクトリメソッド"
"28","UT-COM-028","company.models.ManufacturerPart","__str__","正常系","製造業者名とMPNが連結されること","manufacturerとMPNが設定済み","manufacturer.name=""Acme"", MPN=""MPN-001""","Acme | MPN-001が返却される","低","文字列表現"
"29","UT-COM-029","company.models.ManufacturerPart","__str__","異常系","manufacturerがnullの場合MPNのみ返却されること","manufacturer=None, MPN=""MPN-001""","なし","MPN-001が返却される","低","文字列表現"
"30","UT-COM-030","company.models.SupplierPart","get_api_url","正常系","SupplierPart API URLが正しく返却されること","なし","なし","api-supplier-part-listのURLが返却される","低","静的メソッド"
"31","UT-COM-031","company.models.SupplierPart","get_absolute_url","正常系","詳細ビューURLが返却されること","SupplierPartインスタンスが存在","pk=1","/purchasing/supplier-part/1を含むURLが返却される","低","URLプロパティ"
"32","UT-COM-032","company.models.SupplierPart","api_instance_filters","正常系","インスタンスフィルタが返却されること","SupplierPartにpartが関連付け済み","part.pk=5","{'manufacturer_part': {'part': 5}}が返却される","中","APIフィルタ"
"33","UT-COM-033","company.models.SupplierPart","barcode_model_type_code","正常系","バーコードタイプコードSPが返却されること","なし","なし","SPが返却される","低","クラスメソッド"
"34","UT-COM-034","company.models.SupplierPart","clean","正常系","空のpack_quantityが1に変換されること","pack_quantity=""""","なし","pack_quantity=1になる","高","バリデーション"
"35","UT-COM-035","company.models.SupplierPart","clean","正常系","pack_quantityの前後空白が除去されること","pack_quantity="" 10 ""","なし","pack_quantity=""10""になる","中","バリデーション"
"36","UT-COM-036","company.models.SupplierPart","clean","異常系","pack_quantityが0以下の場合バリデーションエラー","pack_quantity=""0""","なし","ValidationErrorがスローされる","高","バリデーション"
"37","UT-COM-037","company.models.SupplierPart","clean","異常系","pack_quantityが負の値の場合バリデーションエラー","pack_quantity=""-5""","なし","ValidationErrorがスローされる","高","バリデーション"
"38","UT-COM-038","company.models.SupplierPart","clean","異常系","manufacturer_part.partとpartが異なる場合バリデーションエラー","manufacturer_part.part != part","なし","ValidationErrorがスローされる","高","データ整合性"
"39","UT-COM-039","company.models.SupplierPart","clean","正常系","互換性のある単位のpack_quantityが正しく変換されること","part.units=""kg"", pack_quantity=""500g""","なし","pack_quantity_native=0.5になる","高","単位変換"
"40","UT-COM-040","company.models.SupplierPart","clean","異常系","互換性のない単位でバリデーションエラー","part.units=""kg"", pack_quantity=""5m""","なし","ValidationErrorがスローされる","高","単位変換バリデーション"
"41","UT-COM-041","company.models.SupplierPart","save","正常系","manufacturer情報からManufacturerPartが接続されること","manufacturer, MPNがkwargsで渡される","manufacturer=""Acme"", MPN=""MPN-001""","manufacturer_partが設定される","高","データ連携"
"42","UT-COM-042","company.models.SupplierPart","save","異常系","既にmanufacturer_partが設定済みの場合エラー","manufacturer_part既設定, kwargs含む","manufacturer=""Acme"", MPN=""MPN-001""","ValidationErrorがスローされる","高","データ整合性"
"43","UT-COM-043","company.models.SupplierPart","base_quantity","正常系","基本数量が正しく計算されること","pack_quantity_native=10","quantity=5","50が返却される","高","数量計算"
"44","UT-COM-044","company.models.SupplierPart","base_quantity","境界値","quantity=1の場合pack_quantity_nativeが返却されること","pack_quantity_native=10","quantity=1","10が返却される","中","数量計算"
"45","UT-COM-045","company.models.SupplierPart","base_quantity","境界値","quantity=0の場合0が返却されること","pack_quantity_native=10","quantity=0","0が返却される","中","数量計算"
"46","UT-COM-046","company.models.SupplierPart","name","正常系","nameプロパティが__str__と同じ値を返却すること","SupplierPartインスタンスが存在","なし","__str__と同じ文字列が返却される","低","プロパティ"
"47","UT-COM-047","company.models.SupplierPart","manufacturer_string","正常系","製造業者名とMPNが連結されること","manufacturer_partが設定済み","manufacturer.name=""Acme"", MPN=""MPN-001""","Acme | MPN-001が返却される","低","文字列プロパティ"
"48","UT-COM-048","company.models.SupplierPart","manufacturer_string","異常系","manufacturer_partがnullの場合空文字が返却されること","manufacturer_part=None","なし","空文字が返却される","低","文字列プロパティ"
"49","UT-COM-049","company.models.SupplierPart","has_price_breaks","正常系","価格区分がある場合Trueが返却されること","関連するSupplierPriceBreakが存在","なし","Trueが返却される","中","プロパティ"
"50","UT-COM-050","company.models.SupplierPart","has_price_breaks","境界値","価格区分がない場合Falseが返却されること","関連するSupplierPriceBreakが存在しない","なし","Falseが返却される","中","プロパティ"
"51","UT-COM-051","company.models.SupplierPart","price_breaks","正常系","価格区分が数量順でソートされて返却されること","複数のSupplierPriceBreakが存在","なし","quantity昇順のQuerySetが返却される","中","リレーションプロパティ"
"52","UT-COM-052","company.models.SupplierPart","unit_pricing","正常系","単価（数量1の価格）が返却されること","SupplierPriceBreakが存在","なし","数量1での価格が返却される","高","価格計算"
"53","UT-COM-053","company.models.SupplierPart","add_price_break","正常系","新規価格区分が追加されること","指定数量の価格区分が存在しない","quantity=100, price=Money(10, 'USD')","新しいSupplierPriceBreakが作成される","高","価格管理"
"54","UT-COM-054","company.models.SupplierPart","add_price_break","正常系","同一数量の価格区分が既存の場合追加されないこと","指定数量の価格区分が既存","quantity=100, price=Money(10, 'USD')","新規作成されない","中","重複防止"
"55","UT-COM-055","company.models.SupplierPart","open_orders","正常系","オープン状態の発注明細が返却されること","オープン状態のPurchaseOrderLineItemが存在","なし","PurchaseOrderLineItemのQuerySetが返却される","中","発注管理"
"56","UT-COM-056","company.models.SupplierPart","open_orders","境界値","オープン状態の発注がない場合空のQuerySetが返却されること","オープン状態のPurchaseOrderLineItemが存在しない","なし","空のQuerySetが返却される","中","発注管理"
"57","UT-COM-057","company.models.SupplierPart","on_order","正常系","発注中数量が正しく計算されること","quantity=100, received=30の発注明細が存在","なし","70が返却される","高","在庫管理"
"58","UT-COM-058","company.models.SupplierPart","on_order","境界値","発注明細がない場合0が返却されること","発注明細が存在しない","なし","0が返却される","中","在庫管理"
"59","UT-COM-059","company.models.SupplierPart","on_order","境界値","全数量受領済みの場合0が返却されること","quantity=100, received=100","なし","0が返却される","中","在庫管理"
"60","UT-COM-060","company.models.SupplierPart","purchase_orders","正常系","関連する発注書リストが返却されること","関連するPurchaseOrderが存在","なし","PurchaseOrderのリストが返却される","中","リレーション"
"61","UT-COM-061","company.models.SupplierPart","update_available_quantity","正常系","在庫数量と更新日時が更新されること","SupplierPartインスタンスが存在","quantity=500","available=500, availability_updatedが現在時刻になる","高","在庫更新"
"62","UT-COM-062","company.models.SupplierPart","pretty_name","正常系","pretty_nameが__str__と同じ値を返却すること","SupplierPartインスタンスが存在","なし","__str__と同じ文字列が返却される","低","プロパティ"
"63","UT-COM-063","company.models.SupplierPart","__str__","正常系","IPN、サプライヤー名、SKUが連結されること","part.IPN設定済み","part.IPN=""IPN-001"", supplier.name=""Supplier"", SKU=""SKU-001""","IPN-001 | Supplier | SKU-001が返却される","低","文字列表現"
"64","UT-COM-064","company.models.SupplierPart","__str__","正常系","IPNなしの場合サプライヤー名とSKUのみ","part.IPN未設定","supplier.name=""Supplier"", SKU=""SKU-001""","Supplier | SKU-001が返却される","低","文字列表現"
"65","UT-COM-065","company.models.SupplierPart","__str__","正常系","manufacturer_stringがある場合追加されること","manufacturer_part設定済み","manufacturer_string=""Acme | MPN-001""","末尾に | Acme | MPN-001が追加される","低","文字列表現"
"66","UT-COM-066","company.models.SupplierPriceBreak","get_api_url","正常系","SupplierPriceBreak API URLが正しく返却されること","なし","なし","api-part-supplier-price-listのURLが返却される","低","静的メソッド"
"67","UT-COM-067","company.models.SupplierPriceBreak","__str__","正常系","SKU、価格、数量が正しくフォーマットされること","part.SKU, price, quantity設定済み","SKU=""SKU-001"", price=100, quantity=10","SKU-001 - 100 @ 10が返却される","低","文字列表現"
"68","UT-COM-068","company.models.rename_company_image","","正常系","企業画像のリネームが正しく行われること","Companyインスタンスが存在","instance.pk=1, filename=""image.png""","company_images/company_1_img.pngが返却される","低","ヘルパー関数"
"69","UT-COM-069","company.models.rename_company_image","","境界値","拡張子なしのファイル名の場合拡張子なしで返却されること","Companyインスタンスが存在","instance.pk=1, filename=""image""","company_images/company_1_imgが返却される","低","ヘルパー関数"
"70","UT-COM-070","company.models.after_save_supplier_price","","正常系","価格保存後に部品の価格更新がスケジュールされること","SupplierPriceBreakがpart.partに関連付け済み","created=True","schedule_pricing_updateが呼び出される","高","シグナルハンドラ"
"71","UT-COM-071","company.models.after_delete_supplier_price","","正常系","価格削除後に部品の価格更新がスケジュールされること","SupplierPriceBreakがpart.partに関連付け済み","なし","schedule_pricing_updateが呼び出される","高","シグナルハンドラ"
"72","UT-COM-072","company.serializers.CompanySerializer","annotate_queryset","正常系","parts_manufactured, parts_suppliedアノテーションが追加されること","Companyクエリセット","なし","アノテーション付きクエリセットが返却される","中","クエリ最適化"
"73","UT-COM-073","company.serializers.CompanySerializer","save","正常系","リモート画像がダウンロードされて保存されること","remote_image_fileが設定済み","remote_img.format=""PNG""","画像ファイルが保存される","中","画像処理"
"74","UT-COM-074","company.serializers.SupplierPartSerializer","annotate_queryset","正常系","in_stock, on_orderアノテーションが追加されること","SupplierPartクエリセット","なし","アノテーション付きクエリセットが返却される","中","クエリ最適化"
"75","UT-COM-075","company.serializers.SupplierPartSerializer","update","正常系","available数量が更新されること","has_available_quantity=True","available=100","update_available_quantityが呼び出される","高","更新処理"
"76","UT-COM-076","company.serializers.SupplierPartSerializer","create","正常系","SupplierPartが作成されること","バリデーション済みデータ","validated_data","新しいSupplierPartが作成される","高","作成処理"
"77","UT-COM-077","company.serializers.SupplierPartSerializer","create","正常系","manufacturer, MPN情報でManufacturerPartが接続されること","initial_dataにmanufacturer, MPN含む","manufacturer, MPN","save時にkwargsが渡される","高","作成処理"
"78","UT-COM-078","company.serializers.SupplierPriceBreakSerializer","annotate_queryset","正常系","関連テーブルがselect_relatedされること","SupplierPriceBreakクエリセット","なし","最適化されたクエリセットが返却される","中","クエリ最適化"
"79","UT-COM-079","company.filters.annotate_on_order_quantity","","正常系","発注中数量のアノテーションが正しく計算されること","オープン状態の発注明細が存在","quantity=100, received=30","70が計算される","高","フィルタ関数"
"80","UT-COM-080","company.filters.annotate_on_order_quantity","","境界値","発注明細がない場合Decimal(0)が返却されること","発注明細が存在しない","なし","Decimal(0)が返却される","中","フィルタ関数"
"81","UT-COM-081","company.api.CompanyMixin","get_queryset","正常系","アノテーション付きクエリセットが返却されること","なし","なし","annotate_queryset適用済みクエリセットが返却される","中","APIミックスイン"
"82","UT-COM-082","company.api.SupplierPartFilter","filter_company","正常系","製造業者またはサプライヤーでフィルタされること","company_id指定","company=5","manufacturer_partまたはsupplierが5のレコードが返却される","中","APIフィルタ"
"83","UT-COM-083","company.api.SupplierPartFilter","filter_has_stock","正常系","在庫ありでフィルタされること","value=True","なし","in_stock > 0のレコードが返却される","中","APIフィルタ"
"84","UT-COM-084","company.api.SupplierPartFilter","filter_has_stock","正常系","在庫なしでフィルタされること","value=False","なし","in_stock <= 0のレコードが返却される","中","APIフィルタ"
"85","UT-COM-085","company.models.Company","UniqueConstraint","異常系","同一name,emailの組み合わせでエラーとなること","既存のCompany(name,email)が存在","同じname,email","IntegrityErrorがスローされる","高","一意制約"
"86","UT-COM-086","company.models.ManufacturerPart","unique_together","異常系","同一part,manufacturer,MPNの組み合わせでエラーとなること","既存のManufacturerPartが存在","同じpart,manufacturer,MPN","IntegrityErrorがスローされる","高","一意制約"
"87","UT-COM-087","company.models.SupplierPart","unique_together","異常系","同一part,supplier,SKUの組み合わせでエラーとなること","既存のSupplierPartが存在","同じpart,supplier,SKU","IntegrityErrorがスローされる","高","一意制約"
"88","UT-COM-088","company.models.SupplierPriceBreak","unique_together","異常系","同一part,quantityの組み合わせでエラーとなること","既存のSupplierPriceBreakが存在","同じpart,quantity","IntegrityErrorがスローされる","高","一意制約"
"89","UT-COM-089","company.models.Company","is_customer","正常系","is_customerフラグが正しく保存されること","なし","is_customer=True","is_customer=Trueで保存される","中","フラグフィールド"
"90","UT-COM-090","company.models.Company","is_supplier","正常系","is_supplierフラグが正しく保存されること","なし","is_supplier=True","is_supplier=Trueで保存される","中","フラグフィールド"
"91","UT-COM-091","company.models.Company","is_manufacturer","正常系","is_manufacturerフラグが正しく保存されること","なし","is_manufacturer=True","is_manufacturer=Trueで保存される","中","フラグフィールド"
"92","UT-COM-092","company.models.Company","active","正常系","activeフラグのデフォルト値がTrueであること","新規Company作成","active未指定","active=Trueで保存される","中","フラグフィールド"
"93","UT-COM-093","company.models.SupplierPart","active","正常系","activeフラグのデフォルト値がTrueであること","新規SupplierPart作成","active未指定","active=Trueで保存される","中","フラグフィールド"
"94","UT-COM-094","company.models.SupplierPart","multiple","正常系","multipleのデフォルト値が1であること","新規SupplierPart作成","multiple未指定","multiple=1で保存される","中","数値フィールド"
"95","UT-COM-095","company.models.SupplierPart","multiple","異常系","multiple=0でバリデーションエラーとなること","なし","multiple=0","ValidationErrorがスローされる","高","バリデーション"
"96","UT-COM-096","company.models.SupplierPart","base_cost","正常系","base_costのデフォルト値が0であること","新規SupplierPart作成","base_cost未指定","base_cost=0で保存される","中","数値フィールド"
"97","UT-COM-097","company.models.SupplierPart","base_cost","異常系","負のbase_costでバリデーションエラーとなること","なし","base_cost=-10","ValidationErrorがスローされる","高","バリデーション"
"98","UT-COM-098","company.models.SupplierPart","available","正常系","availableのデフォルト値が0であること","新規SupplierPart作成","available未指定","available=0で保存される","中","数値フィールド"
"99","UT-COM-099","company.models.SupplierPart","available","異常系","負のavailableでバリデーションエラーとなること","なし","available=-10","ValidationErrorがスローされる","高","バリデーション"
"100","UT-COM-100","company.models.Company","contacts","正常系","関連するContactが取得できること","Companyに関連するContactが存在","なし","ContactのQuerySetが返却される","中","リレーション"
"101","UT-COM-101","company.models.Company","addresses","正常系","関連するAddressが取得できること","Companyに関連するAddressが存在","なし","AddressのQuerySetが返却される","中","リレーション"
"102","UT-COM-102","company.models.Company","manufactured_parts","正常系","関連するManufacturerPartが取得できること","Companyに関連するManufacturerPartが存在","なし","ManufacturerPartのQuerySetが返却される","中","リレーション"
"103","UT-COM-103","company.models.Company","supplied_parts","正常系","関連するSupplierPartが取得できること","Companyに関連するSupplierPartが存在","なし","SupplierPartのQuerySetが返却される","中","リレーション"
"104","UT-COM-104","company.models.ManufacturerPart","supplier_parts","正常系","関連するSupplierPartが取得できること","ManufacturerPartに関連するSupplierPartが存在","なし","SupplierPartのQuerySetが返却される","中","リレーション"
"105","UT-COM-105","company.models.SupplierPart","pricebreaks","正常系","関連するSupplierPriceBreakが取得できること","SupplierPartに関連するSupplierPriceBreakが存在","なし","SupplierPriceBreakのQuerySetが返却される","中","リレーション"
