Design faster, clearer Django test data and test structure with factories, setUpTestData, SimpleTestCase/TestCase choices, fixture-file cleanup, query optimization, and unit-vs-integration boundaries.
SkillScore86Maintained
Automatic
◆QA & Test Engineering pack
Last verified 8/15/2026
What it changes
Passed 19 of 22 test cases with the skill, and 18 of 22 without it.
Without skill82%
With skill86%
Checks it passed that the model alone missed
The response uses captureOnCommitCallbacks or transaction.atomic rather than inheriting from TransactionTestCase
1 fixed18 passed either way3 still failing0 broke
Pass-rate lift
+5 pp
Tokens
+3%
Agent turns
0%
Response time
-33%
Model gemini-3.6-flashMeasured 8/15/2026v119 of 22 cases passed with skill
Tokens, turns and time describe resource use, not a dollar price.
See it in action
A test case the skill fixed. Same model, same prompt, with and without the skill.
Prompt
We have a Django test module where several tests hit the database to test model validations and transaction callbacks, but many other methods in the same class only format string outputs or parse query parameters. The entire suite currently inherits from `TransactionTestCase` and creates duplicate database rows before every single test method. Please review `test_billing_views.py` and rewrite it to run significantly faster. Return the refactored code and a breakdown of the changes made to database access boundaries and setup methods.
What was checked, without and with the skill
Checked
Without skill
With skill
The response recommends or uses SimpleTestCase for methods that do not require database access
Passed
Passed
The response uses captureOnCommitCallbacks or transaction.atomic rather than inheriting from TransactionTestCase
Missed
Passed
The response uses setUpTestData to share database setup across test methods
Passed
Passed
case-01 · gemini-3.6-flash · 8/15/2026 · answers are capped and redacted
What's inside
The instructions your model reads when the skill loads.
SKILL.md61 lines2 files
Django Test Data
Most slow Django suites spend time building data they do not need or exercising full request/database paths for behavior that can be tested at a smaller boundary. Use this skill to reduce setup cost while keeping representative integration coverage.
Refactoring Workflow
Map the behavior under test.
Identify the smallest useful boundary: function, form, model method, middleware, command helper, view, or full request path.
Keep a few integration tests for wiring; move detailed cases to unit tests where the boundary is clean.