django-tdd

Configure pytest-django and factory_boy for Django REST Framework testing.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/JGcode3675/gcs-os --skill django-tdd-jgcode3675
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: django-tdd
Source: https://github.com/JGcode3675/gcs-os/tree/main/home/james/claude-config/skills/django-tdd
Command: npx skills add https://github.com/JGcode3675/gcs-os --skill django-tdd-jgcode3675

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps developers adopt test-driven development and establish reliable, repeatable testing practices for Django applications so tests are fast, maintainable, and CI-ready.

Core Features & Use Cases

  • Test configuration: Example pytest.ini and test settings for in-memory databases, faster hashing, and disabled migrations to speed up test runs.
  • Fixtures and factories: Conftest fixtures and factory_boy patterns for creating users, products, and related objects to avoid repetitive setup.
  • API and integration testing: Patterns and examples for testing Django REST Framework viewsets, serializers, and full checkout flows including mocking external services.
  • Use Case: Convert a legacy Django app's brittle tests into a clean pytest-driven suite with factories, API client tests, and coverage reporting for CI pipelines.

Quick Start

Use the django-tdd skill to scaffold pytest configuration, conftest fixtures, and factory_boy examples for a Django project with DRF endpoints.

Frequently Asked Questions about django-tdd

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

FAQPage Schema
How do I configure pytest for Django to use an in-memory database and disable migrations?

To configure pytest for Django, you need to set up a custom test settings file and pytest.ini that enables SQLite in-memory databases and disables migrations to significantly speed up test runs. This Skill provides the exact configuration needed for this setup.

What's the best way to test Django REST Framework viewsets and serializers?

The best way to test Django REST Framework viewsets and serializers is by using pytest-django with API client tests and factory_boy patterns to mock data. This Skill provides specific patterns for testing API endpoints and full integration flows.

How do I use factory_boy and conftest fixtures to avoid repetitive test setup in Django?

You can use factory_boy and conftest fixtures to avoid repetitive setup by defining reusable object creation patterns for users, products, and related models. This Skill scaffolds these conftest fixtures and factory examples for your Django project.

How do I mock external services in Django integration tests for checkout flows?

To mock external services in Django integration tests for checkout flows, you apply mocking patterns within your pytest suite to isolate network calls. This Skill includes examples of mocking external services during full checkout flow testing.

Can I generate coverage reporting for a Django pytest suite in a CI pipeline?

Yes, you can generate coverage reporting for a Django pytest suite in a CI pipeline by configuring pytest to track coverage metrics. This Skill helps convert legacy tests into a CI-ready suite with factories and coverage reporting.