Django 测试策略,包括 pytest-django、TDD 方法、factory_boy、模拟、覆盖率以及测试 Django REST Framework API。
73
62%
Does it follow best practices?
Impact
96%
1.28xAverage score across 3 eval scenarios
Advisory
Suggest reviewing before use
Optimize this skill with Tessl
npx tessl skill review --optimize ./docs/zh-CN/skills/django-tdd/SKILL.mdTest infrastructure configuration
DJANGO_SETTINGS_MODULE
100%
100%
testpaths setting
100%
100%
File discovery patterns
100%
100%
addopts --reuse-db
0%
100%
addopts --nomigrations
0%
100%
addopts coverage flags
0%
100%
addopts --strict-markers
0%
100%
Markers declared
0%
100%
SQLite in-memory DB
100%
100%
DisableMigrations class
100%
100%
MD5PasswordHasher
100%
100%
Celery eager settings
100%
100%
timezone_settings fixture
0%
100%
api_client fixture
25%
100%
authenticated_api_client fixture
0%
100%
user and admin_user fixtures
100%
100%
Factory Boy factory definitions
DjangoModelFactory base
100%
100%
Sequence for unique fields
100%
100%
PostGenerationMethodCall password
100%
100%
factory.Faker usage
100%
100%
LazyAttribute for slug
100%
62%
FuzzyInteger for numeric
0%
0%
SubFactory for FK
100%
100%
post_generation for M2M
0%
100%
create_batch usage
100%
100%
No manual ORM creates
100%
100%
Meta class with model
100%
100%
DRF API and external service mocking
Uses APIClient
100%
100%
force_authenticate used
100%
100%
401 for unauthenticated
30%
100%
Patch external SMS service
100%
100%
Patch external email service
100%
100%
Mock return values configured
100%
100%
assert_called on mocks
100%
100%
Service failure tested
100%
100%
Serializer validation tested
100%
100%
User isolation tested
100%
100%
Uses pytest fixtures pattern
0%
100%
5df943e
Table of Contents
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.