Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Tests Django validation across models, forms, views, and templates, placing each rule at the layer that owns it.
Use this skill ↓64% 91%+27 ptsof test cases passed
Passed 20 of 22 test cases with the skill, and 14 of 22 without it.
3 of 3 safety checks passed
Not used yet
| Rule Type | Preferred Home | Test Boundary |
|---|---|---|
| Required input, field shape | Form | Instantiate form and inspect errors |
| Cross-field user input rule | Form clean method | Form test with valid and invalid data |
| Database uniqueness or relationship integrity | Constraint/model | Model or database test |
| Request branch, redirect, template selection | View | Django client test |
| User sees error and can recover | Browser or client/template test | One high-value integration check |
Django model save() does not automatically call full validation. If a rule must be enforced for every write, prefer database constraints or ensure all write paths call the validation boundary intentionally.
When testing constraint failures inside TestCase, use an inner transaction if needed so the test can continue after the expected database error.
ModelForms are valuable when the UI maps naturally to the model. Be cautious when:
Use explicit fields and tests when choosing ModelForm.
Cover duplicates at multiple levels only when each level owns something different:
Skills that do similar work, with their benchmark result.
Next to this one in the catalogue, plus more from the same author.