mitai-jinkendo/backend/tests/test_import_errors.py
Lars 0629f88b37
All checks were successful
Deploy Development / deploy (push) Successful in 55s
Build Test / pytest-backend (push) Successful in 4s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 17s
feat(csv-templates): Add CSV template validation endpoint and enhance error handling
- Introduced a new endpoint for validating CSV templates without saving, allowing users to check field mappings and type conversions.
- Updated the `create_system_template` and `update_system_template` functions to include validation reports in responses.
- Enhanced error handling in CSV import processes by integrating `enrich_row_error` for more informative error messages.
- Improved the AdminCsvTemplateEditorPage to support format checking and display validation results, enhancing user experience.
- Incremented version numbers for `csv_import` and `admin_csv_templates` to reflect these updates.
2026-04-11 06:47:27 +02:00

11 lines
328 B
Python

from csv_parser.import_errors import enrich_row_error
def test_enrich_numeric_overflow():
d = enrich_row_error(
"numeric field overflow\nDETAIL: A field with precision 5, scale 2\n",
module="activity",
)
assert d["code"] == "db_numeric_overflow"
assert d["hint"] and "kj" in d["hint"].lower()