[#507] Refactoring tests, so they know less about the code

Instead of stubbing ckan.lib.render methods, I simply create a
NamedTemporaryFile, add its folder to the template path, and we're done.