I doubt that Iran will test a nuke if it gets one. They know that a test would alert Israel that they have the bomb, and that the next thing on the program would be a mushroom cloud rising over the heap of rubble that was formerly Tehran. I think the first we will know of Iran having the bomb will be when it either explodes or fails to explode in Israel.
Either way that will spell the end of Iran as a functioning nation, because Israel's response will be devastating. Several nukes exploding simultaneously in carefully selected areas of tiny Israel would probably take out most of it's population and infrastructure, but I believe the IDF has the ability to massively retaliate with multiple nukes of it's own even if the homeland is virtually destroyed.
See Post #29 above.
.