refactor TemplateInheritanceTest

Close #719.