evansd/whitenoise — pull request #7 by saulshanabrook (2014-03-14 20:54:20+00:00)
Title: Add GZIP option to collect static

I think it would make sense to have an option to run `gzipstatic` after `collectstatic`. I have added this feature under an optional setting `WHITENOISE_GZIP_COLLECTSTATIC`.

It might seem to be a little weird to override the collectstatic command, but it seems to somewhat of an accepted practice. django-storages [just did the same thing](https://bitbucket.org/david/django-storages/pull-request/89/add-fast-collectstatic-management-command/diff#comment-1357341) with their fast collectstatic command. South also does the same with `syncdb`.

I think my code is right, but I can not get the tests to pass. It must have something to do with the shared `setUpClass` and `tearDownClass` methods, because my new tests pass fine, but they break existing tests. When I comment out my tests, or change the call from `collecstatic` to `gzipstatic`, the other tests pass as well. I tried to figure out how it breaks the other tests, but was unable. I also made a go at refactoring the tests to change the `setUpClass` to `setUp` to see if that would make the tests less dependent on the state of others, but that seemed to break things as well. Would love to get some feedback or ideas on what to do.