"Django project" have basically two files: settings.py
and urls.py
. Deleting urls.py
shouldn't be a problem unless you are actually using it (ie. reverse function).
Riding out of settings.py
would be much harder. You wouldn't be able to use ORM or any other Django components that depends on it. If so, you don't need Django stack and you can run your tests "normal way":
http://docs.python.org/library/unittest.html
But, if you need Django stack ("DJANGO_SETTINGS_MODULE is undefined" means you need it), you also need settings.py
. Probably the best solution for you would be to write generic settings.py
file for all your applications (create empty project for that).
Then setup your INSTALLED_APPS this way:
INSTALLED_APPS = (
...
os.environ['APP_TO_TEST'],
)
Then, if you want to test your app, go to directory with your generic settings.py
file and type:
export APP_TO_TEST="my_app"
# /home/user/dev/my_app is directory with app
export PYTHONPATH="/home/user/dev/"
./manage.py test $APP_TO_TEST
If you need apps dependences in INSTALLED_APPS, you can add another variable.