Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Test-drive Django validation across model constraints, forms, ModelForms, views, template errors, duplicate handling, and redirects. Use when adding or refactoring Django forms, surfacing validation errors, deciding model-vs-form-vs-view responsibility, or preventing invalid input from being saved.
.claude/skills/hashgraph-online-django-forms-validation-tdd/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-03 | ✗→✓ | ▲ Improved | 14% | 0% |
| case-04 | ✗→✓ | ▲ Improved | -8% | 0% |
| case-05 | ✗→✓ | ▲ Improved | 37% | 0% |
| case-08 | ✗→✓ | ▲ Improved | 22% | 0% |
| case-11 | ✗→✓ | ▲ Improved | -1% | 0% |
Use this skill to place validation tests at the layer that owns the rule, then prove the user-facing error path still works. Django validation often crosses model, form, view, and template boundaries; keep those responsibilities explicit.
Primary source: Harry Percival, Test-Driven Development with Python, 3rd ed. Guidance is transformed and paraphrased from chapters 14-16 and Appendix A, especially model constraints, form validation, ModelForm tradeoffs, view-level error surfacing, and duplicate item handling.
Read validation-patterns.md for layer choices and common Django edge cases.
save() can bypass validation, test the path that actually runs validation or enforce the rule with constraints.IntegrityError without a user-facing path and a test.Before finishing, record:
Other measured skills in the registry, with their headline benchmark lift.