[#507] Add tests for ckan/lib/render.py