Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ImportError: 'tests' module incorrectly

I am working on unittest and when I type that :

python manage.py test

I got that :

ImportError: 'tests' module incorrectly imported from '/home/user/Documents/myproject/dev/Project/tests'. Expected '/home/user/Documents/myproject/dev/Project/Project/Project/Project/Project/Project/Project/Project/Project/Project'. Is this module globally installed?

Clearly, the expected path is wrong... Do you know where I can fix that ?

Thank you very much !

like image 701
Peter Avatar asked Mar 21 '26 15:03

Peter


1 Answers

Delete the tests.py file automatically generated by Django. That helped me make it work.

For more information, see this website.

like image 83
Mark Avatar answered Mar 24 '26 09:03

Mark



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!