苦しい時の神頼み
Meanings
1
man turns to God only in times of trouble; there are no atheists in foxholes
Proverb expressing that people tend to seek divine help only when they are in distress, and forget about it once the trouble passes.
Going to a shrine only right before an exam is a classic case of 'man turns to God only in times of trouble,' isn't it?
He's usually not religious, but when he gets sick he starts praying. That's exactly 'there are no atheists in foxholes.'