def METHOD_NAME(app, record_with_bucket, communities):
    """Test Sitemap generators."""
    with app.test_request_context():
        sitemap = current_app.extensions['zenodo-sitemap']
        urls = list(sitemap._generate_all_urls())
        # Make sure the last modified are there and it's in proper UTC sitemap
        # format, but remove from the result for easier comparison of URL sets
        # make sure it's in the format 'YYYY-MM-DDTHH-MM-SST'
        sitemap_dt_re = re.compile('\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z$')
        assert all('lastmod' in url and sitemap_dt_re.match(url['lastmod'])
                   for url in urls)
        for url in urls:
            del url['lastmod']
        expected = [
            {'loc': 'https://localhost/record/12345'},
            {'loc': 'https://localhost/communities/c1/'},
            {'loc': 'https://localhost/communities/c1/search'},
            {'loc': 'https://localhost/communities/c1/about/'},
            {'loc': 'https://localhost/communities/c2/'},
            {'loc': 'https://localhost/communities/c2/search'},
            {'loc': 'https://localhost/communities/c2/about/'},
            {'loc': 'https://localhost/communities/c3/'},
            {'loc': 'https://localhost/communities/c3/search'},
            {'loc': 'https://localhost/communities/c3/about/'},
            {'loc': 'https://localhost/communities/c4/'},
            {'loc': 'https://localhost/communities/c4/search'},
            {'loc': 'https://localhost/communities/c4/about/'},
            {'loc': 'https://localhost/communities/c5/'},
            {'loc': 'https://localhost/communities/c5/search'},
            {'loc': 'https://localhost/communities/c5/about/'},
            {'loc': 'https://localhost/communities/zenodo/'},
            {'loc': 'https://localhost/communities/zenodo/search'},
            {'loc': 'https://localhost/communities/zenodo/about/'},
            {'loc': 'https://localhost/communities/ecfunded/'},
            {'loc': 'https://localhost/communities/ecfunded/search'},
            {'loc': 'https://localhost/communities/ecfunded/about/'},
            {'loc': 'https://localhost/communities/grants_comm/'},
            {'loc': 'https://localhost/communities/grants_comm/search'},
            {'loc': 'https://localhost/communities/grants_comm/about/'},
        ]
        assert urls == expected