I\'m running this command:
python manage.py test project.apps.app1.tests
and it causes this error:
AttributeError: \
I had the same error. It turned out to be because I named my module common.py, yet there already was some other common.py module. All I had to do was to rename my module.
I resolved the error "AttributeError: module 'utils' has no attribute 'name_of_my_function' " by fixing a circular import reference. My files manage.py and utils.py each had an import statement pointing at each other.
Got the same error, but checked all the reasons list here, did not fix my problem.
Finally figure it out that, the reason is that the name of one method that imported but not used yet is not correct. Though it is a stupid error, it happens.
Use:
./manage.py shell
followed by
import myapp.tests
to find the nature of the import error.
I finally figured it out working on another problem. The problem was that my test couldn't find an import.
It looks like you get the above error if your test fails to import. This makes sense because the test suite can't import a broken test. At least I think this is what is going on because I fixed the import within my test file and sure enough it started working.
To validate your test case just try import the test case file in python console.
Example:
from project.apps.app1.tests import *