diff --git a/jupyterhub/tests/test_services_auth.py b/jupyterhub/tests/test_services_auth.py index 01e5b8bd..da5c62e6 100644 --- a/jupyterhub/tests/test_services_auth.py +++ b/jupyterhub/tests/test_services_auth.py @@ -195,9 +195,7 @@ def test_hub_authenticated(request): cookies={'jubal': 'early'}, allow_redirects=False, ) - r.raise_for_status() - assert r.status_code == 302 - assert auth.login_url in r.headers['Location'] + assert r.status_code == 403 # pass group whitelist TestHandler.hub_groups = {'lions'} @@ -214,9 +212,7 @@ def test_hub_authenticated(request): cookies={'jubal': 'early'}, allow_redirects=False, ) - r.raise_for_status() - assert r.status_code == 302 - assert auth.login_url in r.headers['Location'] + assert r.status_code == 403 def test_hubauth_cookie(app, mockservice_url): diff --git a/jupyterhub/tests/test_singleuser.py b/jupyterhub/tests/test_singleuser.py index 064ae94b..84871f6f 100644 --- a/jupyterhub/tests/test_singleuser.py +++ b/jupyterhub/tests/test_singleuser.py @@ -41,8 +41,7 @@ def test_singleuser_auth(app, io_loop): cookies = app.login_user('burgess') r = requests.get(url, cookies=cookies) assert r.status_code == 403 - print(r.text) - assert r.text == '' + assert 'burgess' in r.text def test_disable_user_config(app, io_loop):