Fixed #23768 -- Rewrote template tests as unit tests

can we isolate this test? it fails without running test_cache03 first: `./runtests.py template_tests.syntax_tests.test_cache.CacheTagTests.test_cache04`