def METHOD_NAME(mocker):
    """
    Test that create_user_with_generated_username does not reattempt if an exception was raised that
    does not indicate a username collision
    """
    patched_save = mocker.patch.object(
        UserSerializer, "save", side_effect=ValueError("idk")
    )
    with pytest.raises(ValueError):
        api.create_user_with_generated_username(UserSerializer(data={}), "testuser")
    patched_save.assert_called_once()