Sitemap
This package contains tests of the integreat_cms.sitemap
app
Sitemap Config
This modules contains the config for the sitemap tests
- tests.sitemap.sitemap_config.SITEMAPS: Final[list[tuple[str, str, int]]] = [('/sitemap.xml', 'tests/sitemap/expected-sitemaps/sitemap-index.xml', 42), ('/augsburg/de/sitemap.xml', 'tests/sitemap/expected-sitemaps/sitemap-augsburg-de.xml', 147), ('/augsburg/en/sitemap.xml', 'tests/sitemap/expected-sitemaps/sitemap-augsburg-en.xml', 133), ('/augsburg/ar/sitemap.xml', 'tests/sitemap/expected-sitemaps/sitemap-augsburg-ar.xml', 111), ('/augsburg/fa/sitemap.xml', 'tests/sitemap/expected-sitemaps/sitemap-augsburg-fa.xml', 83), ('/nurnberg/de/sitemap.xml', 'tests/sitemap/expected-sitemaps/sitemap-nurnberg-de.xml', 78), ('/nurnberg/en/sitemap.xml', 'tests/sitemap/expected-sitemaps/sitemap-nurnberg-en.xml', 52), ('/nurnberg/ar/sitemap.xml', 'tests/sitemap/expected-sitemaps/sitemap-nurnberg-ar.xml', 31), ('/nurnberg/fa/sitemap.xml', 'tests/sitemap/expected-sitemaps/sitemap-nurnberg-fa.xml', 24)][source]
The sitemaps
[ ('/sitemap.xml', 'tests/sitemap/expected-sitemaps/sitemap-index.xml', 42), ( '/augsburg/de/sitemap.xml', 'tests/sitemap/expected-sitemaps/sitemap-augsburg-de.xml', 147, ), ( '/augsburg/en/sitemap.xml', 'tests/sitemap/expected-sitemaps/sitemap-augsburg-en.xml', 133, ), ( '/augsburg/ar/sitemap.xml', 'tests/sitemap/expected-sitemaps/sitemap-augsburg-ar.xml', 111, ), ( '/augsburg/fa/sitemap.xml', 'tests/sitemap/expected-sitemaps/sitemap-augsburg-fa.xml', 83, ), ( '/nurnberg/de/sitemap.xml', 'tests/sitemap/expected-sitemaps/sitemap-nurnberg-de.xml', 78, ), ( '/nurnberg/en/sitemap.xml', 'tests/sitemap/expected-sitemaps/sitemap-nurnberg-en.xml', 52, ), ( '/nurnberg/ar/sitemap.xml', 'tests/sitemap/expected-sitemaps/sitemap-nurnberg-ar.xml', 31, ), ( '/nurnberg/fa/sitemap.xml', 'tests/sitemap/expected-sitemaps/sitemap-nurnberg-fa.xml', 24, ), ]
Test Sitemap
- tests.sitemap.test_sitemap.test_sitemap(load_test_data: None, django_assert_num_queries: Callable, url: str, expected_sitemap: str, expected_queries: int) None [source]
This test class checks all URLs defined in
SITEMAPS
. It verifies that the content delivered by the sitemap is equivalent with the data provided in the corresponding xml file.- Parameters:
load_test_data (None) – The fixture providing the test data (see
load_test_data()
)django_assert_num_queries (Callable) – The fixture providing the query assertion
url (str) – The url of the sitemap
expected_sitemap (str) – The path to the xml file that contains the expected sitemap
expected_queries (int) – The expected number of SQL queries
- Return type:
None