django-tdd

Automates Django testing workflows using pytest-django, factory_boy, and DRF.

2|Updated Apr 5, 2026
One-click install
npx skills add https://github.com/mbadoz/mbadoz-skills --skill django-tdd-mbadoz
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: django-tdd
Source: https://github.com/mbadoz/mbadoz-skills/tree/main/plugins/built-planner/skills/built-planner/references/skills/django-tdd
Command: npx skills add https://github.com/mbadoz/mbadoz-skills --skill django-tdd-mbadoz

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Django testing practices can be time-consuming and error-prone. This skill guides teams through implementing robust test-driven development for Django projects using pytest-django, factory_boy, mocking, coverage analysis, and thorough DRF API testing.

Core Features & Use Cases

  • TDD workflow with Red-Green-Refactor to drive code design and reliability.
  • Configured pytest-django setup with fixtures, factories, and test isolation for Django models, views, and serializers.
  • DRF API and serializer testing, including edge cases and coverage reporting.
  • Mocking external services and interactions to keep tests fast and deterministic.
  • Comprehensive test infrastructure guidance for CI, reporting, and maintainability.

Quick Start

Install the recommended testing stack and run the Django test suite to validate models, views, and APIs.

Frequently Asked Questions about django-tdd

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

FAQPage Schema
How do I set up test-driven development for a Django REST Framework API?

Django REST Framework API testing under TDD uses pytest-django and factory_boy to configure fixtures and factories, driving Red-Green-Refactor cycles across serializers, views, and edge cases for reliable API endpoints.

What is the best way to isolate Django model tests with pytest-django?

Isolating Django model tests with pytest-django utilizes dedicated fixtures and factory_boy factories to generate deterministic test data, ensuring each test runs independently without database side effects or external service dependencies.

How do I mock external services in Django tests to keep them deterministic?

Mocking external services in Django tests applies pytest-django patterns to intercept interactions, replacing live API calls with controlled mocks that keep test execution fast, reliable, and deterministic across CI runs.

Do I need factory_boy to write comprehensive Django tests?

factory_boy is required to generate test data for comprehensive Django testing workflows, working alongside pytest-django to configure model factories, fixtures, and test isolation across unit and integration tests.

How does TDD workflow apply to Django views and serializers?

Applying TDD workflow to Django views and serializers follows the Red-Green-Refactor methodology: writing failing tests first, implementing minimum code to pass, and refactoring to drive reliable code design and test coverage.

Can I generate coverage reports for Django and DRF testing infrastructure?

Coverage reports for Django and DRF testing infrastructure are generated through pytest-django configurations, analyzing unit and integration test execution to validate models, views, and APIs while reporting maintainability metrics for CI.