support django 1.5

A couple changes were needed to get the tests passing on django 1.5. I double-checked that they pass in Django 1.4 after these changes as well.

I pulled part of this from #24, thanks @huxley.