orzubalsky / tradeschool

Trade School is an alternative school that runs on barter
Other
16 stars 5 forks source link

Add Travis CI config and fix remaining test failure #147

Closed dnephin closed 10 years ago

dnephin commented 10 years ago

Hello,

This is another branch off of #145. This branch adds a .travis.yml for running the test suite on Travis CI. This is really nice because it lets you see if pull requests break your tests without having to merge and run the tests yourself locally (travis CI will monitor pull requests and pushes to branches and run the test suite each time).

It also ensures that the build is explicit about all dependencies (because if anything was missing it would fail to run the tests).

I've verified the config works by setting it up on my branch, but I think we want it on the main repo (your account). To get it setup for your repo you'll have to follow steps 1 and 2 here: http://docs.travis-ci.com/user/getting-started/#Step-one%3A-Sign-in

I've also added the badge to the README, so we can see if the test suite is green right from github.

This branch also includes two other small changes:

  1. I fixed the broken test (using lower(), and removed settings.LANGUAGE_CODE = language_code. I believe by setting the LANGUAGE_CODE we aren't actually testing the middleware because it would already default to that language. The tests still passed with that line removed
  2. I changed the middleware to use simplejson.loads() instead of ast. I believe the string you are parsing is actually a json string (since this is an ajax request). Although the ast parsing worked, I believe that is just a coincidence because python dicts look basically the same as json objects.