geonode.base.api.tests

Attributes

logger

test_image

Classes

BaseApiTests

TestExtraMetadataBaseApi

TestApiLinkedResources

TestApiAdditionalBBoxCalculation

Module Contents

geonode.base.api.tests.logger[source]
geonode.base.api.tests.test_image[source]
class geonode.base.api.tests.BaseApiTests[source]

Bases: rest_framework.test.APITestCase

fixtures = ['initial_data.json', 'group_test_data.json', 'default_oauth_apps.json', 'test_thesaurus.json'][source]
setUp()[source]
test_groups_list()[source]

Ensure we can access the gropus list.

test_create_group()[source]

Ensure only Admins can create groups.

test_edit_group()[source]

Ensure only admins and group managers can edit a group.

test_delete_group()[source]

Ensure only admins can delete a group.

Calling the resources endpoint of the groups should return also the group permission on that specific resource

test_users_list()[source]

Ensure we can access the users list.

Calling the resources endpoint of the user should return also the user permission on that specific resource

test_get_self_user_details_outside_registered_member()[source]
test_get_self_user_details_with_no_group()[source]
test_register_users()[source]

Ensure users are created with default groups.

test_update_user_profile()[source]

Ensure users cannot update others.

test_delete_user_profile()[source]

Ensure only admins can delete profiles.

test_base_resources()[source]

Ensure we can access the Resource Base list.

test_write_resources()[source]

Ensure we can perform write oprtation afainst the Resource Bases.

test_resource_serializer_validation()[source]

Testing serializing and deserializing of a Dataset base on django-rest description: https://www.django-rest-framework.org/api-guide/serializers/#deserializing-objects

test_delete_user_with_resource()[source]
test_search_resources()[source]

Ensure we can search across the Resource Base list.

test_filter_resources()[source]

Ensure we can filter across the Resource Base list.

test_sort_resources()[source]

Ensure we can sort the Resource Base list.

test_perms_resources()[source]

Ensure we can Get & Set Permissions across the Resource Base list.

Ensure we can Get & Set Permissions across the Resource Base list.

test_resource_types()[source]

Ensure we can Get & Set Permissions across the Resource Base list.

test_get_favorites()[source]

Ensure we get user’s favorite resources.

test_get_favorites_is_returned_in_the_base_endpoint_per_user()[source]

Ensure we get user’s favorite resources.

test_get_favorites_is_returned_in_the_base_endpoint()[source]

Ensure we get user’s favorite resources.

test_create_and_delete_favorites()[source]

Ensure we can add and remove resources to user’s favorite.

test_search_resources_with_favorite_true_and_no_favorite_should_return_0()[source]

Ensure we can search across the Resource Base list.

test_search_resources_with_favorite_true_and_favorite_should_return_1()[source]

Ensure we can search across the Resource Base list.

test_search_resources_with_favorite_true_with_geoapps_icluded()[source]
test_thumbnail_urls()[source]

Ensure the thumbnail url reflects the current active Thumb on the resource.

test_embed_urls()[source]

Ensure the embed urls reflect the concrete instance ones.

test_owners_list()[source]

Ensure we can access the list of owners.

test_categories_list()[source]

Ensure we can access the list of categories.

test_regions_list()[source]

Ensure we can access the list of regions.

test_regions_with_resources()[source]

Ensure we can access the list of regions.

test_keywords_list()[source]

Ensure we can access the list of keywords.

test_tkeywords_list()[source]

Ensure we can access the list of thasaurus keywords.

test_rating_resource()[source]
test_set_resource_thumbnail()[source]
test_set_thumbnail_from_bbox_from_Anonymous_user_raise_permission_error()[source]

Given a request with Anonymous user, should raise an authentication error.

test_set_thumbnail_from_bbox_from_logged_user_for_existing_dataset(mock_create_thumbnail)[source]

Given a logged User and an existing dataset, should create the expected thumbnail url.

test_set_thumbnail_from_bbox_from_logged_user_for_not_existing_dataset()[source]

Given a logged User and an not existing dataset, should raise a 404 error.

test_set_thumbnail_from_bbox_from_logged_user_for_existing_doc()[source]

Given a logged User and an existing doc, should raise a NotImplemented.

test_set_thumbnail_from_bbox_from_logged_user_for_existing_dataset_raise_exp(mock_exp)[source]

Given a logged User and an existing dataset, should raise a ThumbnailException.

test_manager_can_edit_map()[source]

REST API must not forbid saving maps and apps to non-admin and non-owners.

test_resource_service_copy()[source]
test_resource_service_copy_with_perms_dataset()[source]
test_resource_service_copy_with_perms_dataset_set_default_perms()[source]
test_resource_service_copy_with_perms_doc()[source]
test_resource_service_copy_with_perms_map()[source]
_assertCloningWithPerms(resource)[source]

Ensure we can access the Resource Base list.

Ensure we can access the Resource Base list.

Ensure we can access the Resource Base list.

Ensure we can access the Resource Base list.

Ensure we can access the Resource Base list.

Ensure we can access the Resource Base list.

class geonode.base.api.tests.TestExtraMetadataBaseApi[source]

Bases: geonode.tests.base.GeoNodeBaseTestSupport

setUp()[source]
test_get_will_return_the_list_of_extra_metadata()[source]
test_put_will_update_the_whole_metadata()[source]
test_post_will_add_new_metadata()[source]
test_delete_will_delete_single_metadata()[source]
test_user_without_view_perms_cannot_see_the_endpoint()[source]
class geonode.base.api.tests.TestApiLinkedResources[source]

Bases: geonode.tests.base.GeoNodeBaseTestSupport

classmethod setUpClass() None[source]
test_only_get_method_is_available()[source]
test_linked_resource_for_document()[source]
assert_linkedres_size(payload, element: str, expected_size: int)[source]
assert_linkedres_contains(payload, element: str, expected_elements: Iterable)[source]
test_linked_resource_for_maps_mixed()[source]
test_linked_resources_for_maps()[source]
test_linked_resource_for_dataset()[source]
test_linked_resource_for_datasets_mixed()[source]
test_linked_resource_deprecated_pagination()[source]
test_linked_resource_filter_one_resource_type()[source]
test_linked_resource_filter_multiple_resource_type_linktype()[source]
test_linked_resource_filter_multiple_resource_type_without_linktype()[source]
class geonode.base.api.tests.TestApiAdditionalBBoxCalculation[source]

Bases: geonode.tests.base.GeoNodeBaseTestSupport

classmethod setUpClass() None[source]
setUp()[source]
test_dataset_should_not_update_bbox()[source]
test_map_should_not_update_bbox()[source]
test_document_should_update_bbox()[source]
test_geoapp_should_update_bbox()[source]
test_geoapp_send_invalid_bbox_should_raise_error()[source]