geonode.layers.tests

Attributes

logger

Classes

DatasetsTest

Tests geonode.layers app/module

TestLayerDetailMapViewRights

LayerNotificationsTestCase

Helper class for notification tests

DummyUUIDHandler

TestCustomUUidHandler

TestSetMetadata

TestCustomMetadataParser

TestIsXmlUploadOnly

This function will check if the files uploaded is a metadata file

TestIsSldUploadOnly

This function will check if the files uploaded is a metadata file

TestDatasetForm

SetLayersPermissionsCommand

Unittest to ensure that the management command "set_layers_permissions"

TestDatasetDownloadHandler

DummyDownloadHandler

TestCustomDownloadHandler

Functions

dummy_metadata_parser(exml, uuid, vals, regions, ...)

Module Contents

geonode.layers.tests.logger[source]
class geonode.layers.tests.DatasetsTest[source]

Bases: geonode.tests.base.GeoNodeBaseTestSupport

Tests geonode.layers app/module

type = 'dataset'[source]
fixtures = ['initial_data.json', 'group_test_data.json', 'default_oauth_apps.json'][source]
classmethod setUpClass()[source]
classmethod tearDownClass()[source]
setUp()[source]
test_admin_save_model()[source]
test_default_sourcetype()[source]
test_describe_data_2()[source]

/data/geonode:CA/metadata -> Test accessing the description of a layer

test_describe_data_3()[source]

/data/geonode:CA/metadata_detail -> Test accessing the description of a layer

test_dataset_name_clash()[source]
test_describe_data()[source]

/data/geonode:CA/metadata -> Test accessing the description of a layer

test_dataset_attributes()[source]
test_dataset_bbox()[source]
test_dataset_attributes_feature_catalogue()[source]

Test layer feature catalogue functionality

test_dataset_attribute_config()[source]
test_dataset_styles()[source]
test_get_valid_user()[source]
testShapefileValidation()[source]
testGeoTiffValidation()[source]
testASCIIValidation()[source]
testZipValidation()[source]
testWriteFiles()[source]
test_dataset_type()[source]
test_get_files()[source]
test_get_valid_name()[source]
test_get_valid_dataset_name()[source]
testJSONField()[source]
test_rating_dataset_remove()[source]

Test layer rating is removed on layer remove

test_sld_upload()[source]

Test layer remove functionality

test_category_counts()[source]
test_assign_change_dataset_data_perm()[source]

Ensure set_permissions supports the change_dataset_data permission.

test_batch_edit()[source]

Test batch editing of metadata fields.

test_surrogate_escape_string()[source]
test_assign_remove_permissions()[source]
test_assign_remove_permissions_for_groups()[source]
test_xml_form_without_files_should_raise_500()[source]
test_xml_should_return_404_if_the_dataset_does_not_exists()[source]
test_xml_should_update_the_dataset_with_the_expected_values()[source]
test_sld_should_raise_500_if_is_invalid()[source]
test_sld_should_update_the_dataset_with_the_expected_values()[source]
test_xml_should_raise_an_error_if_the_uuid_is_changed()[source]

If the UUID coming from the XML and the one saved in the DB are different The system should raise an error

test_will_raise_exception_for_replace_vector_dataset_with_raster()[source]
test_will_raise_exception_for_replace_dataset_with_unknown_format()[source]
test_will_raise_exception_for_replace_dataset_with_different_file_name()[source]
test_will_raise_exception_for_not_existing_dataset_in_the_catalog(catalog)[source]
test_will_raise_exception_if_schema_is_not_equal_between_catalog_and_file(catalog)[source]
test_validation_will_pass_for_valid_append(catalog)[source]
test_dataset_download_not_found_for_non_existing_dataset()[source]
test_dataset_download_redirect_to_proxy_url()[source]
test_dataset_download_invalid_wps_format()[source]
test_dataset_download_call_the_catalog_raise_error_for_no_200(mocked_catalog)[source]
test_dataset_download_call_the_catalog_raise_error_for_error_content()[source]
test_dataset_download_call_the_catalog_works()[source]
test_dataset_download_call_the_catalog_not_work_without_download_resurcebase_perm()[source]
test_dataset_download_call_the_catalog_work_anonymous()[source]
test_dataset_download_call_the_catalog_work_for_raster(pathed_template)[source]
test_dataset_download_call_the_catalog_work_for_vector(pathed_template)[source]
class geonode.layers.tests.TestLayerDetailMapViewRights[source]

Bases: geonode.tests.base.GeoNodeBaseTestSupport

fixtures = ['initial_data.json', 'group_test_data.json', 'default_oauth_apps.json'][source]
classmethod setUpClass()[source]
classmethod tearDownClass()[source]
setUp()[source]
test_that_keyword_multiselect_is_disabled_for_non_admin_users()[source]

Test that keyword multiselect widget is disabled when the user is not an admin

test_that_keyword_multiselect_is_not_disabled_for_admin_users()[source]

Test that only admin users can create/edit keywords when FREETEXT_KEYWORDS_READONLY=True

test_that_non_admin_user_cannot_create_edit_keyword()[source]

Test that non admin users cannot edit/create keywords when FREETEXT_KEYWORDS_READONLY=True

test_that_keyword_multiselect_is_enabled_for_non_admin_users_when_freetext_keywords_readonly_istrue()[source]

Test that keyword multiselect widget is not disabled when the user is not an admin and FREETEXT_KEYWORDS_READONLY=False

test_that_only_users_with_permissions_can_view_maps_in_dataset_view()[source]

Test only users with view permissions to a map can view them in layer detail view

test_update_with_a_comma_in_title_is_replaced_by_undescore()[source]

Test that when changing the dataset title, if the entered title has a comma it is replaced by an undescore.

class geonode.layers.tests.LayerNotificationsTestCase[source]

Bases: geonode.tests.utils.NotificationsTestsHelper

Helper class for notification tests

This provides:

type = 'dataset'[source]
classmethod setUpClass()[source]
classmethod tearDownClass()[source]
setUp()[source]
testLayerNotifications()[source]
class geonode.layers.tests.DummyUUIDHandler(instance)[source]
instance[source]
create_uuid()[source]
class geonode.layers.tests.TestCustomUUidHandler[source]

Bases: django.test.TestCase

setUp()[source]
test_dataset_will_maintain_his_uud_if_no_handler_is_definded()[source]
test_dataset_will_override_the_uuid_if_handler_is_defined()[source]
class geonode.layers.tests.TestSetMetadata[source]

Bases: django.test.TestCase

setUp()[source]
test_set_metadata_will_rase_an_exception_if_is_not_valid_xml()[source]
test_set_metadata_return_expected_values_from_xml()[source]
test_convert_keyword_should_empty_list_for_empty_keyword()[source]
test_convert_keyword_should_empty_list_for_non_empty_keyword()[source]
class geonode.layers.tests.TestCustomMetadataParser[source]

Bases: django.test.TestCase

setUp()[source]
test_will_use_only_the_default_metadata_parser()[source]
test_will_use_both_parsers_defined()[source]
test_convert_keyword_should_empty_list_for_empty_keyword()[source]
test_convert_keyword_should_non_empty_list_for_empty_keyword()[source]
geonode.layers.tests.dummy_metadata_parser(exml, uuid, vals, regions, keywords, custom)[source]
class geonode.layers.tests.TestIsXmlUploadOnly[source]

Bases: django.test.TestCase

This function will check if the files uploaded is a metadata file

setUp()[source]
test_give_single_file_should_return_True()[source]
test_give_single_file_should_return_False()[source]
class geonode.layers.tests.TestIsSldUploadOnly[source]

Bases: django.test.TestCase

This function will check if the files uploaded is a metadata file

setUp()[source]
test_give_single_file_should_return_True()[source]
test_give_single_file_should_return_False()[source]
class geonode.layers.tests.TestDatasetForm[source]

Bases: geonode.tests.base.GeoNodeBaseTestSupport

setUp() None[source]
test_resource_form_is_invalid_extra_metadata_not_json_format()[source]
test_change_owner_in_metadata()[source]
test_resource_form_is_invalid_extra_metadata_not_schema_in_settings()[source]
test_resource_form_is_invalid_extra_metadata_invalids_schema_entry()[source]
test_resource_form_is_valid_extra_metadata()[source]
test_dataset_time_form_should_work()[source]
test_dataset_time_form_should_work_with_date_attribute()[source]
test_timeserie_raise_error_if_not_valid_attribute()[source]
test_dataset_time_form_should_raise_error_if_invalid_payload()[source]
test_resource_form_is_valid_single_user_contact_role()[source]

test if passing a single user to a contact role form is working

test_resource_form_is_valid_multiple_user_contact_role_as_queryset()[source]

test if passing a multiple user to a contact role form is working

test_resource_form_is_invalid_with_incompleted_timeserie_data()[source]
class geonode.layers.tests.SetLayersPermissionsCommand[source]

Bases: geonode.tests.base.GeoNodeBaseTestSupport

Unittest to ensure that the management command “set_layers_permissions” behaves as expected

test_user_get_the_download_permissions_for_the_selected_dataset()[source]

Given a user, the compact perms and the resource id, it shoul set the permissions for the selected resource

test_user_get_the_view_permissions_for_the_selected_dataset()[source]

Given a user, the compact perms and the resource id, it shoul set the permissions for the selected resource

test_user_get_the_edit_permissions_for_the_selected_dataset()[source]

Given a user, the compact perms and the resource id, it shoul set the permissions for the selected resource

test_user_get_the_manage_permissions_for_the_selected_dataset()[source]

Given a user, the compact perms and the resource id, it shoul set the permissions for the selected resource

test_anonymous_user_cannot_get_edit_permissions()[source]

Given the Anonymous user, we should get an error trying to set “edit” permissions.

test_unset_anonymous_view_permissions()[source]

Given the Anonymous user, we should be able to unset any paermission.

_create_arguments(perms_type, mode='set')[source]
_assert_perms(expected_perms, dataset, username, assertion=True)[source]
class geonode.layers.tests.TestDatasetDownloadHandler[source]

Bases: geonode.tests.base.GeoNodeBaseTestSupport

setUp()[source]
test_get_resource_exists()[source]
test_process_dowload()[source]
class geonode.layers.tests.DummyDownloadHandler(request, resource_name)[source]

Bases: geonode.layers.download_handler.DatasetDownloadHandler

get_download_response()[source]

Basic method. Should return the Response object that allow the resource download

class geonode.layers.tests.TestCustomDownloadHandler[source]

Bases: geonode.tests.base.GeoNodeBaseTestSupport

test_download_custom_handler()[source]