geonode.documents.tests

This file demonstrates writing tests using the unittest module. These will pass when you run “manage.py test”.

Classes

DocumentsTest

DocumentModerationTestCase

DocumentsNotificationsTestCase

DocumentResourceLinkTestCase

DocumentViewTestCase

Module Contents

class geonode.documents.tests.DocumentsTest[source]

Bases: geonode.tests.base.GeoNodeBaseTestSupport

type = 'document'[source]
fixtures = ['initial_data.json', 'group_test_data.json', 'default_oauth_apps.json'][source]
perm_spec[source]
classmethod setUpClass()[source]
classmethod tearDownClass()[source]
setUp()[source]
test_document_mimetypes_rendering()[source]
test_create_document_with_no_rel(thumb)[source]

Tests the creation of a document with no relations

test_remote_document_is_marked_remote()[source]

Tests creating an external document set its sourcetype to REMOTE.

test_download_is_not_ajax_safe()[source]

Remote document is mark as not safe.

test_download_is_ajax_safe()[source]

Remote document is mark as not safe.

test_create_document_url()[source]

Tests creating an external document instead of a file.

test_create_document_url_view()[source]

Tests creating and updating external documents.

test_upload_document_form()[source]

Tests the Upload form.

test_replace_document()[source]
test_non_image_documents_thumbnail()[source]
test_documents_thumbnail()[source]
test_upload_document_form_size_limit()[source]
test_document_embed()[source]

/documents/1 -> Test accessing the embed view of a document

test_access_document_upload_form()[source]

Test the form page is returned correctly via GET request /documents/upload

test_document_isuploaded()[source]

/documents/upload -> Test uploading a document

test_set_document_permissions()[source]

Verify that the set_document_permissions view is behaving as expected

test_ajax_document_permissions(create_thumb)[source]

Verify that the ajax_document_permissions view is behaving as expected

test_batch_edit()[source]
class geonode.documents.tests.DocumentModerationTestCase[source]

Bases: geonode.tests.base.GeoNodeBaseTestSupport

setUp()[source]
_get_input_path()[source]
test_document_upload_redirect()[source]
class geonode.documents.tests.DocumentsNotificationsTestCase[source]

Bases: geonode.tests.utils.NotificationsTestsHelper

setUp()[source]
testDocumentsNotifications()[source]
class geonode.documents.tests.DocumentResourceLinkTestCase[source]

Bases: geonode.tests.base.GeoNodeBaseTestSupport

setUp()[source]

Tests the creation of document links.

class geonode.documents.tests.DocumentViewTestCase[source]

Bases: geonode.tests.base.GeoNodeBaseTestSupport

fixtures = ['initial_data.json', 'group_test_data.json', 'default_oauth_apps.json'][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 when FREETEXT_KEYWORDS_READONLY=True

test_that_keyword_multiselect_is_not_disabled_for_admin_users()[source]

Test that only admin users can create/edit keywords

test_that_non_admin_user_can_create_write_to_map_without_keyword()[source]

Test that non admin users can write to maps without creating/editing 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_non_admin_user_can_create_edit_keyword_when_freetext_keywords_readonly_istrue()[source]

Test that non admin users can edit/create keywords when FREETEXT_KEYWORDS_READONLY=False