def hg_ui_with_jenkins_auth(hg_ui, jenkins_username, jenkins_password):
    """Get test mercurial ui with jenkins auth config set up."""
    hg_ui.setconfig('poke_jenkins', 'username', jenkins_username)
    hg_ui.setconfig('poke_jenkins', 'password', jenkins_password)
    return hg_ui