Your entrance exam is coming soon. I don't think it's time for you to get infatuated with a girl.
(もうすぐ入試でしょう。女の子にうつつを抜かしている場合ではないと思うよ。)
infatuatedは「ぼうっとなった、のぼせ上がった」と言う意味になります。
be/get infatuated with~なら「〜にうつつをぬかす」です。
参考になれば幸いです。
You shouldn’t be fooling around with girls when the entrance exam is so close.
You shouldn’t be fooling around with girls when the entrance exam is so close.
This isn’t the time to be distracted by girls, the entrance exam is coming up.
Stop chasing girls. The entrance exam is just around the corner.
You’re getting carried away with that girl. Focus on the exam.
「入試が近いのに」=when the entrance exam is so close / with the exam coming up
「女の子にうつつを抜かす」=be distracted by girls / chase girls / fool around / be hung up on a girl / get carried away
「している場合じゃない」=This isn’t the time to ~ / You shouldn’t be ~ / It’s not the time for ~