def test_page_consistency_removing_dead_links(search_without_dead_links):
    """
    Test the results returned in consecutive pages are never repeated when
    filtering out dead links.
    """
    total_pages = 100
    pagesize = 5

    page_results = []
    for page in range(1, total_pages + 1):
        page_data = search_without_dead_links(
            q='*',
            pagesize=pagesize,
            page=page
        )
        page_results += page_data['results']

    def no_duplicates(l):
        s = set()
        for x in l:
            if x in s:
                return False
            s.add(x)
        return True

    ids = list(map(lambda x: x['id'], page_results))
    # No results should be repeated so we should have no duplicate ids
    assert no_duplicates(ids)