fix #1000 TemplateTestCase.getWidgetInstance does not work
close #1146