I’m trying to use a different set of configs for testing my django app (like, using in-memory sqlite3 instead of mysql) and for this purpose I’m trying to use another settings module. I run my tests this way:
python manage.py test --settings=test_settings
But Django seems to ignore my test_settings module. Am I doing something wrong?
Is test_settings a file or a directory?
Here’s how I load different settings for tests. In
settings.py, at the bottom:Super bonus! If you want to use sqlite3 for tests, you should activate integrity constraints, so you get the same foreign key exceptions as with mysql (lost of lot of time with this one). In some file of your project: