Test case for clearTemplate