affaan-m avatar

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-code

Installs 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
1pexoai avatarvideoagent-image-studiopexoai/pexo-skillsTired of juggling 8 API keys? This skill gives you one-command access to Midjourney, Flux, Ideogram, and more, with zero setup. Use when you want to generate an5.6Kskills.sh installs
2forcedotcom avatarintegration-connectivity-generateforcedotcom/sf-skillsSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Serv5.5Kskills.sh installs
3affaan-m avatarnutrient-document-processingaffaan-m/eccProcess, convert, OCR, extract, redact, sign, and fill documents using the Nutrient DWS API. Works with PDFs, DOCX, XLSX, PPTX, HTML, and images.5.4Kskills.sh installs
4affaan-m avatarkotlin-exposed-patternsaffaan-m/eccJetBrains Exposed ORM patterns including DSL queries, DAO pattern, transactions, HikariCP connection pooling, Flyway migrations, and repository pattern.5.4Kskills.sh installs
5vercel avatarworkflowvercel/workflowCreates durable, resumable workflows using Vercel's Workflow SDK. Use when building workflows that need to survive restarts, pause for external events, retry on5.4Kskills.sh installs
6jeffallan avatarsecure-code-guardianjeffallan/claude-skillsUse when implementing authentication/authorization, securing user input, or preventing OWASP Top 10 vulnerabilities — including custom security implementations 5.4Kskills.sh installs