geonode.upload.tests.integration

See the README.rst in this directory for details on running these tests.

  • @todo allow using a database other than development.db - for some reason, a test db is not created when running using normal settings

  • @todo when using database settings, a test database is used and this makes it difficult for cleanup to track the layers created between runs

  • @todo only test_time seems to work correctly with database backend test settings

Attributes

GEONODE_USER

GEONODE_PASSWD

GEONODE_URL

GEOSERVER_URL

DB_HOST

DB_PORT

DB_NAME

DB_USER

DB_PASSWORD

DATASTORE_URL

postgis_db

logger

Classes

UploaderBase

TestUpload

TestUploadDBDataStore

Functions

get_wms([version, type_name, username, password])

Function to return an OWSLib WMS object

Module Contents

geonode.upload.tests.integration.GEONODE_USER = 'admin'[source]
geonode.upload.tests.integration.GEONODE_PASSWD = 'admin'[source]
geonode.upload.tests.integration.GEONODE_URL[source]
geonode.upload.tests.integration.GEOSERVER_URL[source]
geonode.upload.tests.integration.DB_HOST[source]
geonode.upload.tests.integration.DB_PORT[source]
geonode.upload.tests.integration.DB_NAME[source]
geonode.upload.tests.integration.DB_USER[source]
geonode.upload.tests.integration.DB_PASSWORD[source]
geonode.upload.tests.integration.DATASTORE_URL[source]
geonode.upload.tests.integration.postgis_db[source]
geonode.upload.tests.integration.logger[source]
geonode.upload.tests.integration.get_wms(version='1.1.1', type_name=None, username=None, password=None)[source]

Function to return an OWSLib WMS object

class geonode.upload.tests.integration.UploaderBase[source]

Bases: geonode.tests.base.GeoNodeBaseTestSupport

type = 'dataset'[source]
classmethod setUpClass()[source]
classmethod tearDownClass()[source]
setUp()[source]
_post_teardown()[source]
tearDown()[source]
check_dataset_geonode_page(path)[source]

Check that the final dataset page render’s correctly after an dataset is uploaded

check_dataset_geoserver_caps(type_name)[source]

Check that a dataset shows up in GeoServer’s get capabilities document

check_dataset_geoserver_rest(dataset_name)[source]

Check that a dataset shows up in GeoServer rest api after the uploader is done

check_and_pass_through_timestep(redirect_to)[source]
complete_raster_upload(file_path, resp, data)[source]
check_save_step(resp, data)[source]

Verify the initial save step

complete_upload(file_path, resp, data, is_raster=False)[source]

Check if a dataset was correctly uploaded to GeoNode.

This method verifies if a dataset is configured properly in both Django and GeoServer.

Parameters:
  • file_path (str) – Path to the dataset file.

  • response (HttpResponse) – Django HTTP response object.

  • Checks

  • ------

  • Django. (- Verifies if the dataset is configured in)

  • GeoServer (- Verifies if the dataset is configured in) –

    • Checks the REST API.

    • Checks the GetCapabilities document.

finish_upload(current_step, dataset_name, is_raster=False, skip_srs=False)[source]
check_upload_model(original_name)[source]
check_dataset_complete(dataset_page, original_name)[source]

Check everything to verify the dataset is complete

check_invalid_projection(dataset_name, resp, data)[source]

Makes sure that we got the correct response from an dataset that can’t be uploaded

check_upload_complete(dataset_name, resp, data)[source]

Makes sure that we got the correct response from an dataset that has been uploaded

check_upload_failed(dataset_name, resp, data)[source]

Makes sure that we got the correct response from an dataset that can’t be uploaded

upload_folder_of_files(folder, final_check, session_ids=None)[source]
upload_file(fname, final_check, check_name=None, session_ids=None)[source]
wait_for_progress(progress_url, wait_for_progress_cnt=0)[source]
temp_file(ext)[source]
make_csv(fieldnames, *rows)[source]
class geonode.upload.tests.integration.TestUpload[source]

Bases: UploaderBase

test_shp_upload()[source]

Tests if a vector dataset can be uploaded to a running GeoNode/GeoServer

test_raster_upload()[source]

Tests if a raster dataset can be upload to a running GeoNode GeoServer

test_zipped_upload()[source]

Test uploading a zipped shapefile

test_geonode_same_UUID_error()[source]

Ensure a new dataset with same UUID metadata cannot be uploaded

test_ascii_grid_upload()[source]

Tests the layers that ASCII grid files are uploaded along with aux

test_invalid_dataset_upload()[source]

Tests the layers that are invalid and should not be uploaded

test_coherent_importer_session()[source]

Tests that the upload computes correctly next session IDs

test_extension_not_implemented()[source]

Verify a error message is return when an unsupported dataset is uploaded

test_csv()[source]

Make sure a csv upload fails gracefully/normally when not activated

test_csv_with_size_limit()[source]

Make sure a upload fails gracefully/normally with big files

test_csv_with_upload_handler_size_limit()[source]

Make sure a upload fails gracefully/normally with big files

class geonode.upload.tests.integration.TestUploadDBDataStore[source]

Bases: UploaderBase

test_csv()[source]

Override the baseclass test and verify a correct CSV upload

test_time()[source]

Verify that uploading time based shapefile works properly

test_configure_time()[source]