django-tdd

Automate test-driven development for Django projects with pytest-django and factory_boy.

Updated Mar 19, 2026
One-click install
npx skills add https://github.com/espensev/ai-skills --skill django-tdd-espensev
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: django-tdd
Source: https://github.com/espensev/ai-skills/tree/main/gemini-skills/skills/django-tdd
Command: npx skills add https://github.com/espensev/ai-skills --skill django-tdd-espensev

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Django projects often suffer from brittle tests and slow feedback loops. This Skill provides a practical, TDD-driven approach using pytest-django, factory_boy, mocking, and DRF testing patterns to stabilize tests and accelerate development.

Core Features & Use Cases

  • TDD workflow integration for Django apps (models, views, serializers, DRF APIs)
  • Factory-based test data management with factory_boy and pytest fixtures
  • Mocking, coverage configuration, and DRF API testing support for robust test suites

Quick Start

Install the package, configure pytest-django, and start writing tests following the TDD workflow for your Django project.

Frequently Asked Questions about django-tdd

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I structure Django testing using a TDD workflow?

Django testing with TDD is automated using structured Red-Green-Refactor workflows. It applies repeatable patterns and pytest-django fixtures to models, views, serializers, and DRF APIs to ensure robust test suites.

How do I manage test data in Django with factory_boy and pytest?

Managing test data in Django with factory_boy involves using pytest fixtures for factory-based test data generation. This approach replaces brittle manual setups to stabilize tests and accelerate development feedback loops.

Does this TDD approach support testing DRF APIs and mocking?

Testing DRF APIs and mocking are fully supported by this Skill. It provides specific DRF API testing patterns, mocking techniques, and coverage configuration to ensure robust and reliable test suites for Django applications.

What's the best way to fix brittle Django tests and slow feedback loops?

Fixing brittle Django tests and slow feedback loops requires a TDD-driven approach using pytest-django and factory_boy. This method stabilizes tests by replacing manual setups with structured, repeatable patterns and mocking.

Can I use pytest-django for test-driven development on existing Django models?

Yes, you can use pytest-django for test-driven development on existing Django models. The workflow integrates pytest-django to apply repeatable testing patterns, mocking, and coverage configuration across your application logic.