Fix test running without django (Closes #161).