Testing in GeoNode

The community encourages the Test Driven Development (TDD) and the contribution
to write new tests to extend the coverage. Ideally every model, view, and utility should becovered by tests.
GeoNode has Unit, Integration and Javascript tests. The Unit tests are located
in the tests file of every django app (Maps, Layers, Documents, Catalogue,
Search, Security etc).

The Integration, CSW and smoke tests are located under the tests folder).

The tests are meant to be ran using the SQLite database, some of them may fail using PostgreSQL or others.

If running them in development mode make sure to have the jetty server

shut down otherwise the test could get stuck. To make sure it is run:

$ paver stop

Unit Tests

To run the unit tests make sure you have the virtualenv active (if running

GeoNode under virtualenv) then run:

$ paver test

This will produce a detailed test report.

It’s possible to run just specific apps tests by using the django command:

$ python manage.py test app/tests.py

Where app can be maps, layers, or others. These tests are based on the Python/django unit test suite.

Integration Tests

To run the unit tests make sure you have the virtualenv active (if running

GeoNode under virtualenv) then run:

$ paver test_integration

To run the csw integration test run:

$ paver test_integration -n geonode.tests.csw

These tests are based on the Python/django unit test suite.

Javascript Tests