fix #381 improve TemplateTestCase::nextTest()

See #381