def back_up_rc(user_config_path):
    """
    Back up an existing cookiecutter rc and restore it after the test.

    If ~/.cookiecutterrc is pre-existing, move it to a temp location
    """
    user_config_path_backup = os.path.expanduser('~/.cookiecutterrc.backup')

    if os.path.exists(user_config_path):
        shutil.copy(user_config_path, user_config_path_backup)
        os.remove(user_config_path)

    yield
    # Remove the ~/.cookiecutterrc that has been created in the test.
    if os.path.exists(user_config_path):
        os.remove(user_config_path)

    # If it existed, restore the original ~/.cookiecutterrc.
    if os.path.exists(user_config_path_backup):
        shutil.copy(user_config_path_backup, user_config_path)
        os.remove(user_config_path_backup)

    Back up an existing cookiecutter rc and restore it after the test.

    If ~/.cookiecutterrc is pre-existing, move it to a temp location
    
tests/test_get_user_config.py