Example of how to use Travis CI to automatically run tests for Django pluggable apps using django-setuptest.
If you've got an existing Django app with tests, you can cherry-pick from this repository in order to make them work with Travis CI. However, prepare to manually merge changes to setup.py in:
git fetch https://github.com/visualspace/django-travis-demo.git git cherry-pick 0333f23014dbd5ada22d4cacc079331d889afa29 git cherry-pick 7e96de8e8cd60351c736ee884a5a3b748eb59547 git cherry-pick f31b9a1dc02a50a99947aea2ee3758235af03b96
After this, check and edit setup.py and test_settings.py, enable Travis for the package, push and you should see your tests being run.
The steps to replicate this work are (roughly) as follows:
- Create GIT repo: git init django-appname
- Create Django app and add to repo: django-admin.py startapp appname
- Add setup.py, see Building and Distributing Packages with Distribute
- Add django-setuptest to setup.py and add create test_settings.py. See 0333f2.
- Add .travis.yml file, see 7e96de.
- Add Travis build status image to README.
- Enable the app for testing with Travis on the Travis profile page.
- Push everything to GitHub.
- Watch your app's tests being run by Travis on several Python and Django versions.