Tests for retrieving documents