This commit is contained in:
Yaojia Wang
2026-02-01 00:08:40 +01:00
parent 33ada0350d
commit a516de4320
90 changed files with 11642 additions and 398 deletions

View File

@@ -17,9 +17,8 @@ from inference.data.admin_models import (
AdminDocument,
AdminAnnotation,
TrainingTask,
FIELD_CLASSES,
CSV_TO_CLASS_MAPPING,
)
from shared.fields import FIELD_CLASSES, CSV_TO_CLASS_MAPPING
class TestBatchUpload:
@@ -507,7 +506,10 @@ class TestCSVToClassMapping:
assert len(CSV_TO_CLASS_MAPPING) > 0
def test_csv_mapping_values(self):
"""Test specific CSV column mappings."""
"""Test specific CSV column mappings.
Note: customer_number is class 8 (verified from trained model best.pt).
"""
assert CSV_TO_CLASS_MAPPING["InvoiceNumber"] == 0
assert CSV_TO_CLASS_MAPPING["InvoiceDate"] == 1
assert CSV_TO_CLASS_MAPPING["InvoiceDueDate"] == 2
@@ -516,7 +518,7 @@ class TestCSVToClassMapping:
assert CSV_TO_CLASS_MAPPING["Plusgiro"] == 5
assert CSV_TO_CLASS_MAPPING["Amount"] == 6
assert CSV_TO_CLASS_MAPPING["supplier_organisation_number"] == 7
assert CSV_TO_CLASS_MAPPING["customer_number"] == 9
assert CSV_TO_CLASS_MAPPING["customer_number"] == 8 # Fixed: was 9, model uses 8
def test_csv_mapping_matches_field_classes(self):
"""Test that CSV mapping is consistent with FIELD_CLASSES."""