Fix django errors with testing