django-tdd

Set up pytest TDD workflows for Django models, views, serializers, and DRF APIs.

6|Updated Feb 25, 2026
One-click install
npx skills add https://github.com/archibate/archibate-skills --skill django-tdd-archibate
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: django-tdd
Source: https://github.com/archibate/archibate-skills/tree/main/old-skills/trash-skills/django-tdd
Command: npx skills add https://github.com/archibate/archibate-skills --skill django-tdd-archibate

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Provide a clear, repeatable testing workflow for Django projects to reduce flaky tests, speed up development feedback, and ensure models, views, serializers, and REST APIs behave as intended.

Core Features & Use Cases

  • Opinionated pytest configuration with reuse-db, no migrations, and coverage reporting to run fast test suites.
  • Test settings and fixtures including in-memory SQLite, faster password hashing, timezone consistency, and reusable authenticated API clients.
  • Factory-driven data using factory_boy for models, bulk creation, and realistic test data combined with DRF APIClient and Django test client examples.
  • Mocking and integration patterns for external services, email, and payment flows to keep tests deterministic.
  • Use Case: Implement and validate a new DRF product API using factories, authenticated API tests, and CI-friendly in-memory database runs.

Quick Start

Use the django-tdd workflow to run pytest with the included test settings, factories, and fixtures to validate your Django models and API endpoints.

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 pytest for Django to run fast integration tests?

Setting up pytest for Django fast integration tests involves configuring pytest-django with in-memory SQLite, disabled migrations, and faster password hashing. This configuration accelerates suite execution by reducing disk I/O and cryptographic overhead.

How do I test DRF API endpoints with factory_boy fixtures?

Testing DRF API endpoints with factory_boy fixtures uses factories to generate realistic model data and authenticated DRF APIClient instances to validate serializers and views. This approach ensures deterministic REST API behavior testing.

What's the best way to keep Django tests deterministic when mocking external services?

Keeping Django tests deterministic when mocking external services requires applying integration patterns that isolate email and payment flows. Mocking these interactions prevents network variability and ensures consistent test outcomes.

Can I use pytest-django with reusable databases and coverage reporting in CI?

Yes, you can use pytest-django with reusable databases and coverage reporting in CI. Enabling the reuse-db flag alongside coverage reporting validates models and APIs quickly across continuous integration runs without full database rebuilds.

Why are my Django tests slow and how can I speed them up?

Django tests are slow due to disk-based databases and default password hashing. Speed them up by configuring test settings to use in-memory SQLite, disabling migrations, and applying faster password hashing to significantly reduce execution time.