向项目中添加一个列出所有测试的管理命令
项目描述
向项目中添加一个列出所有测试的管理命令
快速入门
安装django-list-tests
pip install django-list-tests
将其添加到您的 INSTALLED_APPS
INSTALLED_APPS = (
...
'django_list_tests',
...
)
然后运行
./manage.py list_tests <app_name>
您可以使用此命令进行fzf测试完成
# FZF ALL DAY ERRY DAY function tz() { # cache the test names to speed things up. you can go more complex with # watchman or whatever. if [[ ! -f '.test_names' ]]; then python $DJANGO_MANAGE_SCRIPT list_tests $DJANGO_ROOT_MODULE > ./.test_names fi TESTS=$( cat .test_names | fzf ) echo Runnning "$TESTS" python "$DJANGO_MANAGE_SCRIPT" "test" --keepdb "$TESTS" }