2026-02-10 10:34:45 +01:00
|
|
|
---
|
|
|
|
|
# nuzlocke-tracker-hjkk
|
|
|
|
|
title: Unit tests for Pydantic schemas and model validation
|
2026-02-21 12:41:22 +01:00
|
|
|
status: completed
|
2026-02-10 10:34:45 +01:00
|
|
|
type: task
|
2026-02-21 12:41:22 +01:00
|
|
|
priority: normal
|
2026-02-10 10:34:45 +01:00
|
|
|
created_at: 2026-02-10T09:33:03Z
|
2026-02-21 12:41:22 +01:00
|
|
|
updated_at: 2026-02-21T11:39:58Z
|
2026-02-10 10:34:45 +01:00
|
|
|
parent: nuzlocke-tracker-yzpb
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
Write unit tests for the Pydantic schemas in `backend/src/app/schemas/`. These are pure validation logic and can be tested without a database.
|
|
|
|
|
|
|
|
|
|
## Checklist
|
|
|
|
|
|
2026-02-21 12:41:22 +01:00
|
|
|
- [x] Test `CamelModel` base class (snake_case → camelCase alias generation)
|
|
|
|
|
- [x] Test run schemas — creation validation, required fields, optional fields, serialization
|
|
|
|
|
- [x] Test game schemas — validation rules, field constraints
|
|
|
|
|
- [x] Test encounter schemas — status enum validation, field dependencies
|
|
|
|
|
- [x] Test boss schemas — nested model validation
|
|
|
|
|
- [x] Test genlocke schemas — complex nested structures
|
|
|
|
|
- [x] Test evolution schemas — validation of evolution chain data
|
|
|
|
|
- [x] Test Pokemon create schema (types list, required fields)
|
2026-02-10 10:34:45 +01:00
|
|
|
|
|
|
|
|
## Notes
|
|
|
|
|
|
|
|
|
|
- Focus on: valid input acceptance, invalid input rejection, serialization output format
|
|
|
|
|
- The `CamelModel` base class does alias generation — verify both input (camelCase) and output (camelCase) work
|
|
|
|
|
- Test edge cases like empty strings, negative numbers, missing required fields
|