What problem does it solve?
This Skill helps you avoid brittle Django changes by establishing a repeatable test-driven workflow for models, views, serializers, and DRF APIs.
Core Features & Use Cases
- Red-Green-Refactor TDD workflow: Guides you to write failing tests first, implement the minimum code to pass, then refactor safely.
- pytest-django setup and fast test configuration: Provides pytest settings that speed up feedback loops by using an in-memory SQLite database, reusing the DB, and disabling migrations.
- Test data and API testing patterns: Shows how to use factory_boy for consistent fixtures, validate Django model behavior, and test Django REST Framework endpoints (including auth, create/update/delete, filtering, and search).
- Mocking best practices: Demonstrates how to patch external services and email sending to keep tests deterministic.
Use case: You are adding a new Products API endpoint with authentication, filtering, and validation, and you want a dependable suite of unit + integration tests that runs quickly in CI.
Quick Start
Use the django-tdd skill to generate a complete pytest + factory_boy test scaffold for your Django models and DRF API endpoints and follow the red-green-refactor cycle until coverage and behavior match your requirements.