refactor to get around django settings import error in tests