Install any skill in seconds. Free to start, no credit card required.
Get Started Free →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. Use when Django tests create too much data, rely on slow fixtures, overuse TransactionTestCase, duplicate setup, or need refactoring for speed without losing coverage.
.claude/skills/hashgraph-online-django-test-data/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 4% | 0% |
| case-06 | ✓→✓ | = Same ✓ | -3% | 0% |
| case-02 | ✓→✓ | = Same ✓ | -12% | 0% |
| case-03 | ✓→✓ | = Same ✓ | -13% | 0% |
| case-04 | ✓→✓ | = Same ✓ | 26% | 0% |
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.
SimpleTestCase: no database access.TestCase: ordinary database tests with rollback.TransactionTestCase: committed transaction behavior only.LiveServerTestCase: browser/live-server tests only.setUpTestData.setUpTestData() for database objects reused by multiple methods in a TestCase.select_related, prefetch_related, or bulk_create where setup/query cost is the bottleneck.Read patterns.md for examples and decision details.
SimpleTestCase.captureOnCommitCallbacks() or an inner atomic() is enough.setUpTestData instead of setUp.reset_sequences=True.handle(), forcing tests through call_command().TransactionTestCase as the default.TestCase that only a few subclasses need.setUpTestData and leaking in-memory state to later tests.Before finishing a refactor:
setUpTestData or factories only where it reduces cost.Other measured skills in the registry, with their headline benchmark lift.