# Django TDD

> Django TDD is an open-source agent skill for developer tools. Guides an agent through test-first Django and DRF development with pytest. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf, Goose
- **Website:** https://github.com/smartworldarafath/REA_Skill/tree/main/.agents/skills/django-tdd
- **Repository:** https://github.com/smartworldarafath/rea_skill
- **GitHub stars:** 66
- **License:** MIT
- **Skill name:** django-tdd
- **Collection:** https://github.com/smartworldarafath/REA_Skill
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-12-01

## About

This skill gives an agent a test-driven workflow for Django projects, covering red-green-refactor cycles, pytest-django configuration, and test settings that use an in-memory SQLite database, skip migrations and speed up password hashing. It includes conftest fixtures for users, authenticated clients and DRF API clients, plus factory_boy factories built on Faker and fuzzy values.

The guidance spans model, view, serializer and API viewset tests, with examples of permission checks, filtering and search through DRF endpoints. It also shows how to mock external services such as payment gateways and how to check outgoing email with Django's locmem backend, along with an end-to-end checkout flow test and a coverage target table.

The skill is documentation-only: it ships no scripts. It expects a Django project with pytest-django, factory_boy and Django REST Framework installed, and its examples assume an app layout with apps.* modules and a config.settings package.

## When your agent uses it

> Django testing strategies with pytest-django, TDD methodology, factory_boy, mocking, coverage, and testing Django REST Framework APIs. Use when writing Django or DRF tests with pytest-django, or driving a Django feature test-first.

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Instructions only, no scripts](https://github.com/smartworldarafath/REA_Skill/tree/HEAD/.agents/skills/django-tdd)
- [License: MIT](https://github.com/smartworldarafath/REA_Skill/tree/HEAD/.agents/skills/django-tdd)

## Features

- **TDD Cycle Walkthrough:** Shows a red-green-refactor sequence applied to Django code.
- **pytest-django Setup:** Provides pytest.ini options, markers and a test settings module.
- **Shared Test Fixtures:** Supplies conftest fixtures for users, admins and authenticated clients.
- **factory_boy Factories:** Defines model factories with sequences, Faker values and subfactories.
- **DRF API Testing:** Covers serializer validation and viewset CRUD, filtering and search tests.
- **Mocking and Coverage:** Explains patching external services, checking email and measuring coverage.

## Good for

- Write pytest tests for a Django model with factory data
- Add DRF serializer and endpoint tests with authentication
- Mock a payment gateway in a Django view test
- Set up pytest-django with fast test settings
- Drive a new Django feature test-first

## Install

### Claude Code

This skill ships in the `rea-skills` plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):

```sh
/plugin marketplace add smartworldarafath/REA_Skill
/plugin install rea-skills@smartworldarafath
```

Or copy only this skill to `~/.claude/skills/django-tdd`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/smartworldarafath/REA_Skill.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/django-tdd &&
cp -R "$tmp/.agents/skills/django-tdd" ~/.claude/skills/django-tdd &&
rm -rf "$tmp"
```

For one project only, put the folder in `.claude/skills/django-tdd` inside it instead.

### Codex

Copy the skill folder to `~/.agents/skills/django-tdd` to use it in every repository:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/smartworldarafath/REA_Skill.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/django-tdd &&
cp -R "$tmp/.agents/skills/django-tdd" ~/.agents/skills/django-tdd &&
rm -rf "$tmp"
```

For one repository only, put the folder in `.agents/skills/django-tdd` inside it instead.

### Cursor

Copy the skill folder to `~/.cursor/skills/django-tdd` to use it in every project:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/smartworldarafath/REA_Skill.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/django-tdd &&
cp -R "$tmp/.agents/skills/django-tdd" ~/.cursor/skills/django-tdd &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/django-tdd` inside it instead.

### Gemini CLI

Run in a terminal (add `--scope workspace` to install it for the current workspace only):

```sh
gemini skills install https://github.com/smartworldarafath/REA_Skill.git --path .agents/skills/django-tdd
```

Or copy the folder to `~/.gemini/skills/django-tdd` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/django-tdd`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/smartworldarafath/REA_Skill.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/django-tdd &&
cp -R "$tmp/.agents/skills/django-tdd" ~/.copilot/skills/django-tdd &&
rm -rf "$tmp"
```

For one project only, put the folder in `.github/skills/django-tdd` inside it instead.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/smartworldarafath/REA_Skill.git
```

Then copy `REA_Skill/.agents/skills/django-tdd` into your agent's skills folder as `django-tdd`. Agents that support SKILL.md read one folder per skill.

## FAQ

### What does the skill need to run?

It assumes a Django project using pytest-django, factory_boy and Django REST Framework, with the example apps and settings layout shown in the guide.

### Does Django TDD run any scripts or change files?

No scripts are included. It gives the agent patterns and example code for tests, settings and fixtures.

### When does Django TDD trigger?

It applies when writing Django or DRF tests with pytest-django, or when driving a Django feature test-first.

### How do I install Django TDD in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/django-tdd to use it in all your projects, or to .claude/skills/django-tdd in one project. Or install the rea-skills plugin, which includes it: /plugin marketplace add smartworldarafath/REA_Skill, then /plugin install rea-skills@smartworldarafath.

### Does Django TDD run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

### Which AI agents can use Django TDD?

Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.

### What are the best alternatives to Django TDD?

The closest alternatives to Django TDD are Django patterns, TDD, Django verification, Django celery and TDD loop.

## Where this comes from

- Description: from the skill's own SKILL.md.

## Alternatives

- [Django patterns](https://ai-powered.com/skills/django-patterns): Django patterns is an open-source agent skill for developer tools.
- [TDD](https://ai-powered.com/skills/tdd): TDD is an open-source agent skill for developer tools.
- [Django verification](https://ai-powered.com/skills/django-verification): Django verification is an open-source agent skill for developer tools.
- [Django celery](https://ai-powered.com/skills/django-celery): Django celery is an open-source agent skill for developer tools.
- [TDD loop](https://ai-powered.com/skills/tdd-loop): TDD loop is an open-source agent skill for developer tools.
- [Django security](https://ai-powered.com/skills/django-security): Django security is an open-source agent skill for security.
- [Unittest skill](https://ai-powered.com/skills/unittest-skill): Unittest skill is an open-source agent skill for developer tools.
- [Pytest skill](https://ai-powered.com/skills/pytest-skill): Pytest skill is an open-source agent skill for developer tools.

---
Source: https://ai-powered.com/skills/django-tdd
