fix login issue with django 1.7: check_for_test_cookie is deprecated and removed in django 1.7.