Fix pytest-django pinning and allow some DB access

This isn't being used anywhere, is it?