Fixed #23768 -- Rewrote template tests as unit tests

preferred format: "#12554 - Make sure ..."