[Django]-Why are my App tests not being recognized by Django tests?

2👍

One option to have a good sleep and don’t even think about test discovery is to use nose. It has a lot features, one of it is automatic tests discovery.

There is package called django_nose that will help you to integrate your django project with nose:

Features

All the goodness of nose in your Django tests, like…

  • Obviating the need to import all your tests into tests/__init__.py. This not only saves busy-work but also eliminates the possibility of accidentally shadowing test classes.

Hope that helps.

👤alecxe

2👍

You will require to change your Tests to tests and import every test to tests/__init__.py up until django 1.5 AFAIK. Also there is a test runner which will work the way unittest2 discovery work. This functionality has been integrated into django1.6.

1👍

Have a look at: running tests in Django

Test discovery is based on the unittest module’s built-in test discovery. By default, this will discover tests in any file named “test*.py” under the current working directory.

👤ambi

Leave a comment