Skip to content
affaan-m avatar

Django Tdd

Pytest-django test setup, factory_boy fixtures, and TDD workflow for Django and DRF apps.

CCM score
65 of 100
skills.sh installs
13.3K
GitHub stars
312.6K
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers the red-green-refactor cycle for Django models, views, and serializers, with pytest-django as the test runner
  • Includes a pytest.ini with --reuse-db, --nomigrations, and coverage reporting, plus a test settings module
  • Provides conftest fixtures for users, API clients, and force-authenticated sessions, plus factory_boy factories
  • Designed for writing Django or DRF tests with pytest-django, or building a feature test-first

Install

$ npx -y skills add affaan-m/ecc --skill django-tdd -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

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

Details

Repository
github.com/affaan-m/ecc
Categories
Testing & QA, Python
First seen
Jul 14, 2026

Questions

What does the django-tdd skill do?

The django-tdd skill guides test-driven development for Django applications using pytest-django, factory_boy, mocking, coverage, and testing of Django REST Framework APIs. It covers pytest configuration, test settings, conftest fixtures, and factories for models.

Which category does django-tdd belong to and how does it compare?

django-tdd sits in the Testing & QA category and ranks in the top 50 there. It sets itself apart by focusing on Django specifically, with pytest-django setup, factory_boy factories, and Django REST Framework API testing.

How do I install the django-tdd skill?

Run npx -y skills add affaan-m/ecc --skill django-tdd -y inside your project. Once installed, the agent can write and run Django tests driven by the red-green-refactor workflow.

Who should use django-tdd and what does it need?

This skill is for developers writing Django or DRF tests with pytest-django, or building a Django feature test-first. It assumes a Django project with pytest-django and factory_boy available, plus a settings module for tests.

More from affaan-m/ecc

All 257

Similar to Django Tdd

More Testing & QA