geonode.proxy.tests

This file demonstrates two different styles of tests (one doctest and one unittest). These will both pass when you run “manage.py test”.

Replace these with more appropriate tests for your application.

Attributes

TEST_DOMAIN

TEST_URL

Classes

ProxyTest

DownloadResourceTestCase

OWSApiTestCase

TestProxyTags

Module Contents

geonode.proxy.tests.TEST_DOMAIN = '.github.com'[source]
geonode.proxy.tests.TEST_URL[source]
class geonode.proxy.tests.ProxyTest[source]

Bases: geonode.tests.base.GeoNodeBaseTestSupport

setUp()[source]
test_validate_host_disabled_in_debug()[source]

If PROXY_ALLOWED_HOSTS is empty and DEBUG is True, all hosts pass the proxy.

test_validate_host_disabled_not_in_debug()[source]

If PROXY_ALLOWED_HOSTS is empty and DEBUG is False requests should return 403.

test_proxy_allowed_host()[source]

If PROXY_ALLOWED_HOSTS is not empty and DEBUG is False requests should return no error.

test_validate_remote_services_hosts()[source]

If PROXY_ALLOWED_HOSTS is empty and DEBUG is False requests should return 200 for Remote Services hosts.

test_relative_urls()[source]

Proxying to a URL with a relative path element should normalise the path into an absolute path before calling the remote URL.

test_proxy_preserve_headers()[source]

The GeoNode Proxy should preserve the original request headers.

test_proxy_url_forgery()[source]

The GeoNode Proxy should preserve the original request headers.

class geonode.proxy.tests.DownloadResourceTestCase[source]

Bases: geonode.tests.base.GeoNodeBaseTestSupport

setUp()[source]
test_download_url_with_not_existing_file()[source]
test_download_url_with_existing_files(fopen, fexists)[source]
test_download_files(fopen, fexists)[source]
class geonode.proxy.tests.OWSApiTestCase[source]

Bases: geonode.tests.base.GeoNodeBaseTestSupport

setUp()[source]
test_ows_api()[source]
class geonode.proxy.tests.TestProxyTags[source]

Bases: geonode.tests.base.GeoNodeBaseTestSupport

setUp()[source]
test_should_return_false_if_no_files_are_available()[source]
test_should_return_true_if_files_are_available(fexists)[source]