Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I run Django project-level tests?

This seems like a no-brainer, and I'm hesitant to admit that I've spent about two hours trying to find the answer, but I can't figure out how to run project-level tests for a django project.

Just to be clear, running tests for the apps in the project is no problem. I understand './manage.py test', but it doesn't find the project-level tests that I have written.

I tried putting the project-level tests in 'my-django-project/tests.py' and 'my-django-project/tests/testcode.py' but these tests aren't found. What am I missing?

like image 922
JivanAmara Avatar asked Jul 15 '10 08:07

JivanAmara


2 Answers

There's no such thing. Put all your tests in an app.

like image 137
Daniel Roseman Avatar answered Sep 23 '22 17:09

Daniel Roseman


While there isn't something built into Django, Django-nose finds and runs tests at the project level as well as any subdirectories. Unfortunately, it doesn't find tests for installed apps that aren't placed in a subdirectory of the project directory.

Installation instructions can be found at: http://pypi.python.org/pypi/django-nose/0.1

like image 33
JivanAmara Avatar answered Sep 24 '22 17:09

JivanAmara