richleland/django-cumulus — pull request #122 by absoludity (2013-12-03 16:53:07+00:00)
Title: Add helper for setting pyrax settings, add unit-tests and Makefile

So it turns out with my previous commit, the pyrax settings weren't being set from the commands, only the storage. So things worked when the storage class happened to be loaded, but not otherwise.

This branch fixes that by adding a utils.ensure_pyrax_settings which is called from both storage and the commands.

I then took some time to add some unit-tests for that as well as one of the commands, move the integration tests (and code needed by integration tests like the Thing model) out of the cumulus package. The Makefile and friends should make it easier to run tests.

Here's an example grabbing the branch, running unit tests and integration tests: https://gist.github.com/absoludity/7772357

Notes:
* The one failing integration test (wrong size reported) only fails when run together with other test cases, otherwise it passes. I'll create an issue for that (tomorrow) with more details.
* You'll see i've updated the example.settings.common to pull in the relevant environment vars when they're defined. Why don't we do this in cumulus.settings? (not in this branch, but just a thought for the future).