def METHOD_NAME(env, jupyterhub_auth, caplog):
    # test case where something goes wrong
    env['JUPYTERHUB_API_TOKEN'] = 'abcd1234'
    env['JUPYTERHUB_USER'] = 'foo'
    with requests_mock.Mocker() as m:
        _mock_api_call(m.get, '/groups', status_code=403)
        jupyterhub_auth.add_student_to_course('foo', 'course123')
        assert 'ERROR' in [rec.levelname for rec in caplog.records]