geonode.documents.tests ======================= .. py:module:: geonode.documents.tests .. autoapi-nested-parse:: This file demonstrates writing tests using the unittest module. These will pass when you run "manage.py test". Classes ------- .. autoapisummary:: geonode.documents.tests.DocumentsTest geonode.documents.tests.DocumentModerationTestCase geonode.documents.tests.DocumentsNotificationsTestCase geonode.documents.tests.DocumentResourceLinkTestCase geonode.documents.tests.DocumentViewTestCase Module Contents --------------- .. py:class:: DocumentsTest Bases: :py:obj:`geonode.tests.base.GeoNodeBaseTestSupport` .. py:attribute:: type :value: 'document' .. py:attribute:: fixtures :value: ['initial_data.json', 'group_test_data.json', 'default_oauth_apps.json'] .. py:attribute:: perm_spec .. py:method:: setUpClass() :classmethod: .. py:method:: tearDownClass() :classmethod: .. py:method:: setUp() .. py:method:: test_document_mimetypes_rendering() .. py:method:: test_create_document_with_no_rel(thumb) Tests the creation of a document with no relations .. py:method:: test_remote_document_is_marked_remote() Tests creating an external document set its sourcetype to REMOTE. .. py:method:: test_download_is_not_ajax_safe() Remote document is mark as not safe. .. py:method:: test_download_is_ajax_safe() Remote document is mark as not safe. .. py:method:: test_create_document_url() Tests creating an external document instead of a file. .. py:method:: test_create_document_url_view() Tests creating and updating external documents. .. py:method:: test_upload_document_form() Tests the Upload form. .. py:method:: test_replace_document() .. py:method:: test_non_image_documents_thumbnail() .. py:method:: test_documents_thumbnail() .. py:method:: test_upload_document_form_size_limit() .. py:method:: test_document_embed() /documents/1 -> Test accessing the embed view of a document .. py:method:: test_access_document_upload_form() Test the form page is returned correctly via GET request /documents/upload .. py:method:: test_document_isuploaded() /documents/upload -> Test uploading a document .. py:method:: test_set_document_permissions() Verify that the set_document_permissions view is behaving as expected .. py:method:: test_ajax_document_permissions(create_thumb) Verify that the ajax_document_permissions view is behaving as expected .. py:method:: test_batch_edit() .. py:class:: DocumentModerationTestCase Bases: :py:obj:`geonode.tests.base.GeoNodeBaseTestSupport` .. py:method:: setUp() .. py:method:: _get_input_path() .. py:method:: test_document_upload_redirect() .. py:class:: DocumentsNotificationsTestCase Bases: :py:obj:`geonode.tests.utils.NotificationsTestsHelper` .. py:method:: setUp() .. py:method:: testDocumentsNotifications() .. py:class:: DocumentResourceLinkTestCase Bases: :py:obj:`geonode.tests.base.GeoNodeBaseTestSupport` .. py:method:: setUp() .. py:method:: test_create_document_with_links() Tests the creation of document links. .. py:class:: DocumentViewTestCase Bases: :py:obj:`geonode.tests.base.GeoNodeBaseTestSupport` .. py:attribute:: fixtures :value: ['initial_data.json', 'group_test_data.json', 'default_oauth_apps.json'] .. py:method:: setUp() .. py:method:: test_that_keyword_multiselect_is_disabled_for_non_admin_users() Test that keyword multiselect widget is disabled when the user is not an admin when FREETEXT_KEYWORDS_READONLY=True .. py:method:: test_that_featured_enabling_and_disabling_for_users() .. py:method:: test_that_keyword_multiselect_is_not_disabled_for_admin_users() Test that only admin users can create/edit keywords .. py:method:: test_that_non_admin_user_can_create_write_to_map_without_keyword() Test that non admin users can write to maps without creating/editing keywords when FREETEXT_KEYWORDS_READONLY=True .. py:method:: test_that_non_admin_user_cannot_create_edit_keyword() Test that non admin users cannot edit/create keywords when FREETEXT_KEYWORDS_READONLY=True .. py:method:: test_that_keyword_multiselect_is_enabled_for_non_admin_users_when_freetext_keywords_readonly_istrue() Test that keyword multiselect widget is not disabled when the user is not an admin and FREETEXT_KEYWORDS_READONLY=False .. py:method:: test_that_non_admin_user_can_create_edit_keyword_when_freetext_keywords_readonly_istrue() Test that non admin users can edit/create keywords when FREETEXT_KEYWORDS_READONLY=False .. py:method:: test_document_link_with_permissions()