
Django Tdd
This is a comprehensive Django testing setup that goes beyond basic pytest configuration. It covers the full TDD workflow with practical examples of factory_boy for test data generation, pytest fixtures for authentication, and testing patterns for models, views, and DRF APIs. The conftest setup and test settings are production-ready, including smart optimizations like in-memory databases and disabled migrations. What stands out is the thoroughness: you get complete factories with post-generation hooks, coverage configuration, and real examples of testing edge cases like price validation and stock management. If you're setting up testing infrastructure for a Django project or teaching a team TDD practices, this gives you working code to adapt rather than starting from scratch.
- skills.sh installs
- 5.8K
- GitHub stars
- 300.3K
- last updated
- Aug 21, 2026
Install
$ npx -y skills add affaan-m/ecc --skill django-tdd --agent claude-codeInstalls into .claude/skills of the current project.
Files
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')
assert user.email == 'test@example.com'
assert user.check_password('testpass123')
assert not user.is_staff
# Step 2: GREEN - Make test pass
# Create User model or factory
# Step 3: REFACTOR - Improve while keeping tests green
Setup
pytest Configuration
Sponsors
Details
- Repository
- github.com/affaan-m/ecc
- Categories
- Backend & APIs, Testing & QA, Python
- First seen
- Jul 14, 2026
More from affaan-m/ecc
All 263- Dashboard Builder5.7K
- Redis Patterns5.7K
- Eval Harness5.7K
- Manim Video5.7K
- Content Engine5.7K
- Springboot Tdd5.7K
- Motion Patterns5.7K
- Configure Ecc5.7K
- Token Budget Advisor5.7K
- Investor Materials5.7K
- Agent Introspection Debugging5.7K
- Laravel Verification5.7K
- Marketing Campaign5.7K
- Motion Foundations5.7K
- Kotlin Testing5.7K
- Ai Regression Testing5.7K
- Dart Flutter Patterns5.7K
- Mysql Patterns5.7K
- Production Audit5.7K
- Documentation Lookup5.7K
- Make Interfaces Feel Better5.7K
- Windows Desktop E2e5.7K
- Motion Advanced5.6K
- Cost Aware Llm Pipeline5.6K