geonode.tests.utils

Attributes

logger

Classes

Client

client for making http requests

NotificationsTestsHelper

Helper class for notification tests

Functions

upload_step([step])

get_web_page(url[, username, password, login_url])

Get url page possible with username and password.

check_dataset(uploaded)

Verify if an object is a valid Dataset.

Module Contents

geonode.tests.utils.logger[source]
geonode.tests.utils.upload_step(step=None)[source]
class geonode.tests.utils.Client(url, user, passwd, *args, **kwargs)[source]

Bases: django.test.client.Client

client for making http requests

url[source]
user[source]
passwd[source]
csrf_token = None[source]
response_cookies = None[source]
_session[source]
_retry[source]
_adapter[source]
_register_user()[source]
make_request(path, data=None, ajax=False, debug=True, force_login=False)[source]
get(path, debug=True)[source]
login()[source]

Method to login the GeoNode site

upload_file(_file, perms=None)[source]

function that uploads a file, or a collection of files, to the GeoNode

get_html(path, debug=True)[source]

Method that make a get request and passes the results to bs4 Takes a path and returns a tuple

get_json(path)[source]
get_csrf_token(last=False)[source]

Get a csrf_token from the home page or read from the cookie jar based on the last response

geonode.tests.utils.get_web_page(url, username=None, password=None, login_url=None)[source]

Get url page possible with username and password.

geonode.tests.utils.check_dataset(uploaded)[source]

Verify if an object is a valid Dataset.

class geonode.tests.utils.NotificationsTestsHelper[source]

Bases: geonode.tests.base.GeoNodeBaseTestSupport

Helper class for notification tests

This provides:

setup_notifications_for(notifications_list, user)[source]
clear_notifications_queue()[source]
check_notification_out(notification_name, user)[source]

Return True if user received notification