geonode.base.tests

Attributes

test_image

Classes

ThumbnailTests

TestThumbnailUrl

TestCreationOfMissingMetadataAuthorsOrPOC

TestCreationOfContactRolesByDifferentInputTypes

Test that contact roles can be set as people profile

RenderMenuTagTest

Test class for render_menu and render_top_menu custom tags of base_tags

DeleteResourcesCommandTests

ConfigurationTest

TestOwnerRightsRequestUtils

SanitizedHtmlTest

TestGetVisibleResource

TestHtmlTagRemoval

TestTagThesaurus

Loading test thesausurs

TestThesaurusAvailableForm

Loading test thesausurs

TestFacets

TestGenerateThesaurusReference

TestHandleMetadataKeyword

Test_HierarchicalTagManager

TestRegions

LinkedResourcesTest

Module Contents

geonode.base.tests.test_image[source]
class geonode.base.tests.ThumbnailTests[source]

Bases: geonode.tests.base.GeoNodeBaseTestSupport

setUp()[source]
tearDown()[source]
test_initial_behavior()[source]

Tests that an empty resource has a missing image as null.

test_empty_image()[source]

Tests that an empty image does not change the current resource thumbnail.

test_monochromatic_image(image)[source]

Tests that an monochromatic image does not change the current resource thumbnail.

test_thumb_utils_methods(image)[source]

Bunch of tests on thumb_utils helpers.

class geonode.base.tests.TestThumbnailUrl[source]

Bases: geonode.tests.base.GeoNodeBaseTestSupport

setUp()[source]
class geonode.base.tests.TestCreationOfMissingMetadataAuthorsOrPOC[source]

Bases: ThumbnailTests

test_add_missing_metadata_author_or_poc()[source]

Test that calling add_missing_metadata_author_or_poc resource method setsa missing metadata_author and/or point of contact (poc) to resource owner

class geonode.base.tests.TestCreationOfContactRolesByDifferentInputTypes[source]

Bases: ThumbnailTests

Test that contact roles can be set as people profile

test_set_contact_role_as_people_profile()[source]
test_set_contact_role_as_list_of_people()[source]
test_set_contact_role_as_queryset()[source]
class geonode.base.tests.RenderMenuTagTest[source]

Bases: geonode.tests.base.GeoNodeBaseTestSupport

Test class for render_menu and render_top_menu custom tags of base_tags

setUp()[source]
test_get_menu_placeholder_0()[source]
test_get_menu_placeholder_1()[source]
test_render_nav_menu_placeholder_0()[source]
test_render_nav_menu_placeholder_1()[source]
class geonode.base.tests.DeleteResourcesCommandTests[source]

Bases: geonode.tests.base.GeoNodeBaseTestSupport

test_delete_resources_no_arguments()[source]
test_delete_resources_too_many_arguments()[source]
test_delete_resource_config_file_not_existing()[source]
test_delete_resource_config_file_empty()[source]
class geonode.base.tests.ConfigurationTest[source]

Bases: geonode.tests.base.GeoNodeBaseTestSupport

test_read_only_whitelist()[source]
test_read_only_casual_user_privileges()[source]
test_maintenance_whitelist()[source]
test_maintenance_false()[source]
test_maintenance_true()[source]
test_readonly_overwrite_by_env()[source]
test_readonly_is_not_overwrite_by_env()[source]
class geonode.base.tests.TestOwnerRightsRequestUtils[source]

Bases: django.test.TestCase

setUp()[source]
test_get_concrete_resource()[source]
test_msg_recipients_admin_mode()[source]
test_msg_recipients_workflow_off()[source]
test_display_change_perms_button_tag_moderated()[source]
test_display_change_perms_button_tag_standard()[source]
class geonode.base.tests.SanitizedHtmlTest[source]

Bases: django.test.TestCase

test_sanitized_html()[source]
class geonode.base.tests.TestGetVisibleResource[source]

Bases: django.test.TestCase

setUp()[source]
test_category_data_not_shown_for_missing_resourcebase_permissions()[source]

Test that a user without view permissions of a resource base does not see ISO category format data of the ISO category

test_category_data_shown_for_with_resourcebase_permissions()[source]

Test that a user with view permissions of a resource base can see ISO format data of the ISO category

test_visible_notifications()[source]

Test that a standard user won’t be able to show ADMINS_ONLY_NOTICE_TYPES

test_extent_filter_crossing_dateline()[source]
class geonode.base.tests.TestHtmlTagRemoval[source]

Bases: django.test.SimpleTestCase

test_not_tags_in_attribute()[source]
test_simple_tags_in_attribute()[source]
test_complex_tags_in_attribute()[source]
test_converted_html_in_tags_with_char_references()[source]
test_converted_html_in_tags_with_with_multiple_tags()[source]
class geonode.base.tests.TestTagThesaurus[source]

Bases: django.test.TestCase

Loading test thesausurs

fixtures = ['test_thesaurus.json'][source]
setUp()[source]
test_get_unique_thesaurus_list()[source]
test_get_thesaurus_title()[source]
test_get_thesaurus_date()[source]
test_get_name_translation_raise_exception_if_identifier_does_not_exists()[source]
test_get_name_translation_return_thesauro_title_if_label_for_selected_language_does_not_exists(lang)[source]
test_get_thesaurus_translation_by_id(lang)[source]
test_get_thesaurus_localized_label(lang)[source]
test_get_name_translation_return_label_title_if_label_for_selected_language_exists(lang)[source]
static __get_last_thesaurus()[source]
class geonode.base.tests.TestThesaurusAvailableForm[source]

Bases: django.test.TestCase

Loading test thesausurs

fixtures = ['test_thesaurus.json'][source]
setUp()[source]
test_form_is_valid_if_all_fields_are_missing()[source]

Is now always true since the required is moved to the UI (like the other fields)

test_form_is_invalid_if_fileds_send_unexpected_values()[source]
test_form_is_valid_if_fileds_send_expected_values()[source]
test_field_class_treq_is_correctly_set_when_field_is_required()[source]
test_field_class_treq_is_not_set_when_field_is_optional()[source]
test_will_return_thesaurus_with_the_expected_defined_order()[source]
test_will_return_thesaurus_with_the_defaul_order_as_0()[source]

Update thesaurus order to 0 in order to check if the default order by id is observed

test_get_thesuro_key_label_with_cmd_language_code()[source]

In python test language code look like ‘en’ this test checks if key label result function returns correct results

test_get_thesuro_key_label_with_browser_language_code()[source]

In browser scenario language does not look like “it”, but rather include coutry code like “it-it” this test checks if _get_thesauro_keyword_label can handle this

class geonode.base.tests.TestFacets[source]

Bases: django.test.TestCase

setUp()[source]
test_facets_filter_datasets_returns_correctly()[source]
class geonode.base.tests.TestGenerateThesaurusReference[source]

Bases: django.test.TestCase

fixtures = ['test_thesaurus.json'][source]
setUp()[source]

If the keyword.about does not exists, the url created will have a prefix and a specifier: as prefix:

  • use the Keyword’s thesaurus.about URI if it exists,

  • otherwise use as prefix the geonode site URL composed with some thesaurus info: f’{settings.SITEURL}/thesaurus/{thesaurus.identifier}’

as specifier:

  • we may use the ThesaurusKeyword.alt_label if it exists, otherwise its id

So the final about field value will be composed as f’{prefix}#{specifier}’

test_should_return_keyword_url()[source]

Check if the expected about has been created and that the instance is correctly updated

test_should_return_as_url_thesaurus_about_and_keyword_alt_label()[source]
test_should_return_as_url_thesaurus_about_and_keyword_id()[source]
test_should_return_as_url_site_url_and_keyword_label()[source]
test_should_return_as_url_site_url_and_keyword_id()[source]
class geonode.base.tests.TestHandleMetadataKeyword[source]

Bases: django.test.TestCase

fixtures = ['test_thesaurus.json'][source]
setUp()[source]
test_return_empty_if_keywords_is_an_empty_list()[source]
test_should_return_the_expected_keyword_extracted_from_raw_and_the_thesaurus_keyword()[source]
test_should_assign_correclty_the_keyword_to_the_dataset_object()[source]
test_is_thesaurus_available_should_return_queryset_with_existing_thesaurus()[source]
test_is_thesaurus_available_should_return_empty_queryset_for_non_existing_thesaurus()[source]
class geonode.base.tests.Test_HierarchicalTagManager[source]

Bases: geonode.tests.base.GeoNodeBaseTestSupport

setUp() None[source]
tearDown() None[source]
test_keyword_are_correctly_saved()[source]
test_keyword_raise_integrity_error(keyword_fetch_method)[source]
test_keyword_raise_db_error(add_root_mocked)[source]
class geonode.base.tests.TestRegions[source]

Bases: geonode.tests.base.GeoNodeBaseTestSupport

setUp()[source]
test_region_assignment_for_extent()[source]
test_regions_are_assigned_if_handler_is_used()[source]
class geonode.base.tests.LinkedResourcesTest[source]

Bases: geonode.tests.base.GeoNodeBaseTestSupport

test_autocomplete_linked_resource()[source]