Utils
This package contains tests for the integreat_cms.cms.utils
package.
Test Internal Link Checker
- tests.cms.utils.test_internal_link_checker.prepage_url(link: str, trailing_slash: bool) Url [source]
Make sure a link either has or doesn’t have a trailing slash
- tests.cms.utils.test_internal_link_checker.test_check_internal_invalid(load_test_data: None, link: str, trailing_slash: bool) None [source]
Check whether the given internal URL is correctly identified as invalid link
- Parameters:
load_test_data (None) – The fixture providing the test data (see
load_test_data()
)link (str) – The URL to check
trailing_slash (bool) – Whether to ensure the trailing slash
- Return type:
None
- tests.cms.utils.test_internal_link_checker.test_check_internal_skipped(load_test_data: None, link: str, trailing_slash: bool) None [source]
Check whether the given internal URL is correctly skipped
- Parameters:
load_test_data (None) – The fixture providing the test data (see
load_test_data()
)link (str) – The URL to check
trailing_slash (bool) – Whether to ensure the trailing slash
- Return type:
None
- tests.cms.utils.test_internal_link_checker.test_check_internal_valid(load_test_data: None, link: str, trailing_slash: bool) None [source]
Check whether the given internal URL is correctly identified as valid link
- Parameters:
load_test_data (None) – The fixture providing the test data (see
load_test_data()
)link (str) – The URL to check
trailing_slash (bool) – Whether to ensure the trailing slash
- Return type:
None
Test Slug Utils
- tests.cms.utils.test_slug_utils.test_generate_unique_slug_fallback(settings: SettingsWrapper, load_test_data: None) None [source]
Test whether the
generate_unique_slug_helper()
function correctly uses the fallback property when no slug is provided- Parameters:
settings (SettingsWrapper) –
load_test_data (None) –
- Return type:
None
- tests.cms.utils.test_slug_utils.test_generate_unique_slug_no_fallback() None [source]
Test whether the
generate_unique_slug_helper()
throws adjango.core.exceptions.ValidationError
, while the fallback property does not exist- Return type:
None
- tests.cms.utils.test_slug_utils.test_generate_unique_slug_reserved_page_slug(settings: SettingsWrapper, load_test_data: None) None [source]
Test whether the
generate_unique_slug_helper()
function function returns the correct unique slug when the new page slug is a reserved slug- Parameters:
settings (SettingsWrapper) –
load_test_data (None) –
- Return type:
None
- tests.cms.utils.test_slug_utils.test_generate_unique_slug_reserved_region_slug(settings: SettingsWrapper, load_test_data: None) None [source]
Test whether the
generate_unique_slug_helper()
function returns the correct unique slug when the new region slug is a reserved slug- Parameters:
settings (SettingsWrapper) –
load_test_data (None) –
- Return type:
None
Test Translation Utils
- tests.cms.utils.test_translation_utils.test_translate_link() None [source]
Test whether the
translate_link()
function correctly escapes message text while preserving the link tags- Return type:
None