How to run django tests in Eclipse to make debugging possible, but on test database

时间秒杀一切 提交于 2019-12-30 11:15:37

问题


I've got problem concerning me a long time. I either run tests from eclipse (Python unittest) using Pydev or Nose test runner. That way it's possible to debug tests and watch them in PyUnit view. But that way test database is not created, manage.py is not used.

Or I run them via manage.py test - test db is being created, but above features not available that way.

Is that possible to debug tests in eclipse which are being run on test db?

Regards, okrutny


回答1:


You can create a new PyDev django debug configuration in eclipse and set the program arguments to 'test'.

In this case, the debug configuration will execute the following command: `python manage.py test' and your breakpoints inside test cases will get hit.



来源:https://stackoverflow.com/questions/18769092/how-to-run-django-tests-in-eclipse-to-make-debugging-possible-but-on-test-datab

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!