Test case for prepareTemplate