How to run unittest for Django?

Posted by photon on Stack Overflow See other posts from Stack Overflow or by photon
Published on 2010-04-25T05:50:03Z Indexed on 2010/04/25 7:03 UTC
Read the original article Hit count: 330

Filed under:
|
|

I configured properties for my django project under pydev. I can run the django app under pydev or under console window. But I have problems to run unittest under pydev. I cannot run unittest for app under console window either.

I guessed it's something related to run configurations of pydev, so I made several trials, but with no success.

Once I got messages like this:

ImportError: Could not import settings 'D:\django_projects\MyProject' (Is it on sys.path? Does it have syntax errors?): No module named D:\django_projects\MyProject
ERROR: Module: MyUnittestFile could not be imported.

Another time I got messages like this:

ImportError: Could not import settings 'MyProject.settngs' (Is it on sys.path? Does it have syntax errors?): No module named settngs
'ERROR: Module: MyUnittestFile could not be imported.

I use pydev 1.5.6 on eclipse and windows xp.
Any ideas for this problem?

Now I think it's not something related to pydev, thanks for Xavier Ho's suggestion.

© Stack Overflow or respective owner

Related posts about python

Related posts about django