【发布时间】:2011-10-14 20:13:04
【问题描述】:
由于导入 django.test 模块失败,单元测试不起作用。
>>> import django.test
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Python27\lib\site-packages\django\test\__init__.py", line 5, in <mod
le>
from django.test.client import Client, RequestFactory
File "C:\Python27\lib\site-packages\django\test\client.py", line 21, in <modu
e>
from django.test import signals
ImportError: cannot import name signals
>>>
请有人帮我解决它。我正在使用 django 1.3 版
【问题讨论】:
-
您能否提供更多安装信息?您是否检查了 C:\Python27\lib\site-packages\django\test\ 文件夹中是否存在 signals.py 文件?
-
您是否使用
python manage.py shell运行shell? -
请将
code与问题分开。请编辑您的问题以仅缩进code而不是缩进问题。
标签: python django django-unittest