django-tdd
Django testing strategies with pytest-django, TDD methodology, factory_boy, mocking, coverage, and testing Django REST Framework APIs.
Target: Software development & testing. Automatically collected · unverified.
Excerpt from the author’s documentation
Extracted from a fixed version of SKILL.md in its original language. This is the author’s documentation; installation, compatibility and runtime results have not been verified by this site.
Read the original Japanese text
Topics in the source
- Django テスト駆動開発(TDD)
- いつ有効化するか
- DjangoのためのTDDワークフロー
- Red-Green-Refactorサイクル
- セットアップ
- pytest設定
- テスト設定
- conftest.py
pytest、factoryboy、Django REST Frameworkを使用したDjangoアプリケーションのテスト駆動開発。 新しいDjangoアプリケーションを書くとき Django REST Framework APIを実装するとき Djangoモデル、ビュー、シリアライザーをテストするとき Djangoプロジェクトのテストインフラを設定するとき ファクトリーを使用: 手動オブジェクト作成の代わりに テストごとに1つのアサーション: テストを焦点を絞る 説明的なテスト名: testusercannotdeleteotherspost エッジケースをテスト: 空の入力、None値、境界条件 外部サービスをモック: 外部APIに依存しない フィクスチャを使用: 重複を排除 パーミッションをテスト: 認可が機能することを確認 テストを高速に保つ: --reuse-dbと--nomigrationsを使用 Django内部をテストしない: Djangoが機能することを信頼 サードパーティコードをテストしない: ライブラリが機能することを信頼 失敗するテストを無視しない: すべてのテストが通る必要がある テストを依存させない: テストは任意の順序で実行できるべき 過度にモックしない: 外部依存関係のみをモック プライベートメソッドをテストしない: パブリックインターフェースをテスト 本番データベースを使用しない: 常にテストデータベースを使用 | コンポーネント | 目標カバレッジ | |-----------|-----------------| | モデル | 90%+ | | シリアライザー | 85%+ | | ビュー | 80%+ | | サービス | 90%+ | | ユーティリティ | 80%+ | | 全体 | 80%+ | | パターン | 使用法 | |---------|-------| | @pytest.mark.djangodb | データベースアクセスを有効化 | | client | Djangoテストクライアント | | apiclient | DRF APIクライアント | | factory.createbatch(n) | 複数のオブジェクトを作成 | | patch('module.function') | 外部依存関係をモック | | overridesettings | 設定を一時的に変更 | | forceauthenticate() | テストで認証をバイパス | | assertRedirects | リダイレクトをチェック | | assertTemplateUsed | テンプレート使用を検証 | | mail.outbox | 送信されたメールをチェック | 覚えておいてください: テストはドキュ
This is an excerpt. Refer to the complete source and its current requirements.
- Source repository
- affaan-m/ECC
- Source file
- docs/ja-JP/skills/django-tdd/SKILL.md
- Fixed revision
- d2ef2680594f9a17526a6e1a2e18b3d242c5d17b
Requirements
- Only the author’s Skill metadata is included. Read the full instructions to check dependencies, licensing and conditions of use.
A small first task
先阅读原作者说明,再决定是否在自己的 AI 工具中使用。
Instructions for your AI tool
- Claude Desktop: resource-specific guide not available yet
- Claude Code: resource-specific guide not available yet
- Cursor: resource-specific guide not available yet
- Codex: resource-specific guide not available yet
Author documentation is not live verification by this site. Without evidence, we do not mark a resource as compatible, safe or free.
Sources and evidence
This record was collected automatically. Its documentation, suitability and runtime behavior have not been manually verified.
Author: affaan-m/ECC · original repository metadata. Documentation review: Not reviewed. Last source check: 2026-11-09T14:01:49.144Z.
Categories are inferred from names, descriptions and paths. They do not establish compatibility.
License and attribution
MIT. Third-party content and copyright remain with their authors. Refer to the original license and terms.
Original license ↗Synchronization, copying and user-reported success do not mark a resource as runtime-tested.
Limitations and notes
- Collecting metadata does not mean this site has installed, adapted, runtime-tested or security-reviewed the resource.