Remove extra query nesting from tests