Test get document

Initial tests for get_document_or_404 as suggested in #4760 


there are various utilities floating around (i recall @sravfeyn raising this a while back as well)