Fixed #23768 -- Rewrote template tests as unit tests

Sometimes you use docstrings, other times you put the comment inline above the test. Is there a reason for the difference?