fair-weather friend noun
A person who stops being a friend in times of difficulty.
Hope he votes for his friend in the booth.