我有一个使用 Tastypie 用 django webFrameWork 编写的集成测试案例。
测试文件.py
from django.utils import unittest
@unittest.skip('skipping')
def test_admission(self):
self.check_entity('admission',admission,'Not validate ')
在终端上运行集成测试用例的命令:
(/home/arya/trunk/integrationtests) arya-$ nosetests -v test_file.py
在导入 django.utils 以跳过此 integrationTest 案例时,终端上抛出以下错误:
错误输出:
Failure: ImportError (No module named django.utils) ... ERROR
======================================================================
ERROR: Failure: ImportError (No module named django.utils)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/nose/loader.py", line 390, in loadTestsFromName
addr.filename, addr.module)
File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 39, in importFromPath
return self.importFromDir(dir_path, fqname)
File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 86, in importFromDir
mod = load_module(part_fqname, fh, filename, desc)
File "/home/arya/trunk/integrationtests/test_file.py", line 1, in <module>
from django.utils import unittest
ImportError: No module named django.utils
----------------------------------------------------------------------
Ran 1 test in 0.001s
FAILED (errors=1)
是设置有问题还是其他原因?