Only country I can recall holding full national elections during wartime with any part of its territory occupied is Denmark.

That was with its pre-war government still in full civilian control of its territory, however.