That's called being a two faced lier.
Cognitive dissonance requires psychological stress as a driver of change in attitude.
Politicians seem incapable of changing their beliefs, typically because most of them are narcissistic.
Narcissism, self absorption general, and a lack of empathy, better explains why ploticians espouse differing beliefs depending on who and when the audience is.
Edit: fixed a word