Improve work with resources in tests