Selfcleaned tests

Some improvements in the test code has made them selfcleaned. It's related to https://jira.man.poznan.pl/jira/browse/WFE-1108.