[Django]-Suddenly when running tests I get "TypeError: 'NoneType' object is not iterable

45👍

Just had this error, caused by an issue I had solved months ago and accidentally happened upon briefly again.

The problem is that when you specify the directory for django test you should use python notation for the directory, not standard shell notation. For example

Correct – project.tests.test_module

Incorrect – project/tests/test_module.py

5👍

I wasn’t able to explain WHY this is so, but when I ran the “python manage.py test list/” without specifying the file name, things worked perfectly well.

Thanks to user Ella Shar, I will be changing the scheme/layout I set my tests to the approved dotted format as described in the documentation

0👍

For me, it was a Database issue.

Apparently, the run stopped in the middle and he did not have time to delete the DB of the tests.

Deleting the DB test solves the issue

Leave a comment