def METHOD_NAME(self, _generate_home_page_stats):
    """Ensure that the home page cache is configured."""
    _generate_home_page_stats.return_value = 5
    # Let's pull invalidate off of the mock so that main() will decorate it again as a cache.
    del _generate_home_page_stats.invalidate
    assert not hasattr(_generate_home_page_stats, 'invalidate')
    server.main({}, testing='guest', session=self.db)
    # main() should have given it a cache, which would give it an invalidate attribute.
    assert hasattr(generic._generate_home_page_stats, 'invalidate')
    assert generic._generate_home_page_stats() == 5
    # Changing the return value of the mock should not affect the return value since it is
    # cached.
    _generate_home_page_stats.return_value = 7
    assert generic._generate_home_page_stats() == 5
    # If we invalidate the cache, we should see the new return value.
    generic._generate_home_page_stats.invalidate()
    assert generic._generate_home_page_stats() == 7