I have a Django project that already has some unit tests using the standard Django testing framework. That works well. Now I want to set up integration tests with Travis CI, but I'm hitting several blockers:
./manage.py testunit tests from the integration tests, that require external services to be set up. I want to only run unit tests on my dev machine and Travis CI to run both unit and integration tests. How do I separate these?
1- You can run any test you want from the manage.py test command. So you can create a file unit_test.py and run only the tests inside this file.
manage.py test --help
2- You don't want to do that. Run test against a production/semi-production database is a shame. You need to create fixtures for every tests, and run your tests against a temporary database. If you really want to know the answer, it has already been answered here