Trying to make a 3AA battery case
I've used 3xAA to D battery adapters for powering devices. The enclosure is professional in appearance and permits one to attach wiring as needed, or to use single contact attachments in the same manner as that of a D battery.

The image above is from Amazon but there are many sources of adapters of this nature.
It's easier to find AAA mini-flashlights, so I'm using this as an example only. I've opened up the cheap/free flashlight and soldered wires to the housing to create a 3xAAA enclosure with convenient power switch. You didn't ask for such a mechanism, but it was referenced in the comments and is a valid solution if you can locate a 3xAA flashlight, otherwise, the adapter provides an off-the-shelf solution to your objective.