tests: Fix test running when Django isn't available.