Polish the apple

To try to win someone’s favor by flattering him or her.

The teacher does not like students who try to polish the apple with her.