我對django和pycharm都是新手!我可以在終端上使用我的代碼運行測試:在pyCharm中配置沒有遷移的django測試
python manage.py test Repo/tests/testUnit1.py --failfast -n
它的工作原理!最近,我試圖使用pycharm(專業版)來運行和調試測試。問題是,當我指定的選項--nomigrations
它提供了以下錯誤:
Usage: /Applications/PyCharm.app/Contents/helpers/pycharm/django_test_manage.py test [options]
[path.to.modulename|path.to.modulename.TestCase|path.to.modulename.TestCase.test_method]...
Discover and run tests in the specified modules or the current directory.
/Applications/PyCharm.app/Contents/helpers/pycharm/django_test_manage.py: error: no such option: --nomigrations
我發現類似的問題here,但它表明,我已經嘗試過同樣的事情。這是否會發生,因爲測試單元和我想測試的代碼不在同一個文件夾中?我如何在沒有遷移的情況下在pycharm中運行測試?
謝謝!比我的答案更可讀! – MhFarahani