PyCharm找不到Django测试

时间:2015-06-27 13:59:42

标签: python django pycharm

我遇到了这个very same issue,但我找不到解决方法。

找到我为此here创建的虚拟Django项目。

这是我的测试配置:

enter image description here

这是项目结构:

enter image description here

尝试运行测试结果:

AttributeError: 'super' object has no attribute 'run_tests'

Process finished with exit code 137
Empty test suite.

显然,从shell运行它不会产生任何错误:

(django)mosquito@mosquito-X550LD ~/python_projects/django_test $ python manage.py test 
Creating test database for alias 'default'...
.
----------------------------------------------------------------------
Ran 1 test in 0.000s

OK
Destroying test database for alias 'default'...

知道我做错了吗?

谢谢, 亚历

1 个答案:

答案 0 :(得分:1)

在项目配置中,添加另一个

的环境变量

DJANGO_SETTINGS_MODULE = django_test.settings

您可以点击“...”图标

来执行此操作