django-tdd

Installation
Summary

Comprehensive TDD guide for Django with pytest, factory_boy, and DRF API testing.

  • Covers the red-green-refactor cycle with pytest configuration, test settings, and conftest fixtures for models, views, and API endpoints
  • Factory Boy patterns for creating test data, including sequences, relationships, and post-generation hooks
  • Model, view, serializer, and API ViewSet testing strategies with real code examples for CRUD operations and filtering
  • Mocking and patching techniques for external services, email, and payment gateways; integration testing for multi-step workflows
  • Best practices checklist (use factories, one assertion per test, mock external dependencies) and coverage targets by component type
SKILL.md

Django Testing with TDD

Test-driven development for Django applications using pytest, factory_boy, and Django REST Framework.

When to Activate

  • Writing new Django applications
  • Implementing Django REST Framework APIs
  • Testing Django models, views, and serializers
  • Setting up testing infrastructure for Django projects

TDD Workflow for Django

Red-Green-Refactor Cycle

# Step 1: RED - Write failing test
def test_user_creation():
    user = User.objects.create_user(email='test@example.com', password='testpass123')
Related skills
Installs
4.0K
GitHub Stars
180.7K
First Seen
Feb 1, 2026