Permalink
Switch branches/tags
debian/2.10.0+rc4 debian/2.10.0+rc3 debian/2.10.0+rc2 debian/2.10.0+rc1 debian/2.10.0+rc0 debian/2.8.1+rc0 debian/2.8.0+thefinal0 debian/2.8.0+rc13 debian/2.8.0+rc12 debian/2.8.0+rc11 debian/2.8.0+rc10 debian/2.8.0+rc9 debian/2.8.0+rc8 debian/2.8.0+rc7 debian/2.8.0+rc6 debian/2.8.0+rc5 debian/2.8.0+rc4 debian/2.8.0+rc3 debian/2.8.0+rc2 debian/2.8.0+rc1 debian/2.8.0+rc0 debian/2.7.5+dev20180124154147 debian/2.7.5+dev20180123112419 debian/2.7.4+dev20171114153121 debian/2.7.2+dev20171013181704 debian/2.7.1+dev20171013111656 debian/2.7.0+thefinal0 debian/2.6.3+thefinal0 debian/2.6.2+thefinal0 debian/2.6.1+thefinal0 debian/2.6.0+thefinal0 debian/2.6.0+rc1 debian/2.6.0+beta1 debian/2.6.0+alpha1 debian/2.5.15+thefinal0 debian/2.5.14+thefinal0 debian/2.5.13+thefinal0 debian/2.5.12+thefinal0 debian/2.5.11+thefinal0 debian/2.5.10+thefinal0 debian/2.5.9+thefinal5 debian/2.5.9+thefinal4 debian/2.5.9+thefinal3 debian/2.5.9+thefinal2 debian/2.5.9+thefinal1 debian/2.5.9+thefinal0 debian/2.5.9+dev20170116091118 debian/2.5.7+thefinal0 debian/2.5.6+thefinal0 debian/2.5.5+thefinal0 debian/2.5.4+thefinal0 debian/2.5.3+thefinal0 debian/2.5.2+thefinal0 debian/2.5.1+thefinal0 debian/2.5.0+thefinal0 debian/2.4.1+thefinal1 debian/2.4.0+thefinal0 debian/2.4.0+rc4 debian/2.4.0+rc3 debian/2.4.0+rc2 debian/2.4.0+rc1 debian/2.4.0+dev20141024171719 debian/2.4.0+beta28 debian/2.4.0+beta27 debian/2.4.0+beta26 debian/2.4.0+beta25 debian/2.4.0+beta24 debian/2.4.0+beta23 debian/2.4.0+beta22 debian/2.4.0+beta21 debian/2.4.0+beta20 debian/2.4.0+beta19 debian/2.4.0+beta18 debian/2.4.0+beta17 debian/2.4.0+beta16 debian/2.4.0+beta15 debian/2.4.0+beta14 debian/2.4.0+beta13 debian/2.4.0+beta12 debian/2.4.0+beta11 debian/2.4.0+beta10 debian/2.4.0+beta9 debian/2.4.0+beta8 debian/2.4.0+beta7 debian/2.4.0+beta6 debian/2.4.0+beta5 debian/2.4.0+beta4 debian/2.4.0+beta3 debian/2.4.0+beta2 debian/2.4.0+beta1 debian/2.4.0+alpha38 debian/2.4.0+alpha37 debian/2.4.0+alpha36 debian/2.4.0+alpha35 debian/2.4.0+alpha34 debian/2.4.0+alpha33 debian/2.4.0+alpha32 debian/2.4.0+alpha31 debian/2.4.0+alpha30 debian/2.4.0+alpha29
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
87 lines (46 sloc) 2.71 KB
.. _geonode_testing:
Testing in GeoNode
==================
The community encourages Test Driven Development (TDD) and the contribution of new tests to extend test coverage. Ideally every model, view, and utility should be covered 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).
.. warning:: The tests are meant to be ran using the SQLite database, some of them may fail using PostgreSQL or others. Therefore **remove or rename your local_settings.py file before running the tests**.
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:
.. code-block:: console
$ paver stop
Unit Tests
----------
To run the unit tests make sure you have the virtualenv active (if running GeoNode under virtualenv) then run:
.. code-block:: console
$ paver test # or python setup.py test when testing development versions
This will produce a detailed test report.
It's possible to run just specific apps tests by using the Django command:
.. code-block:: console
$ python manage.py test app/tests.py
For example:
.. code-block:: console
$ python manage.py test geonode.maps.tests
To run a single test case or method (omit the method name to run the whole class), for example:
.. code-block:: console
$ python manage.py test geonode.maps.tests:MapsTest.test_maps_search
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:
.. code-block:: console
$ paver test_integration # or python setup.py test_integration when testing development versions
To run the CSW integration test run:
.. code-block:: console
$ paver test_integration -n geonode.tests.csw
Like the unit tests above, it is also possible to test specific modules, for example:
.. code-block:: console
$ paver test_integration -n geonode.tests.integration:GeoNodeMapTest.test_search_result_detail
To test with with coverage:
.. code-block:: console
$ python manage.py test geonode.maps.tests -- --with-coverage --cover-package=geonode.maps
These tests are based on the Python/Django unit test suite.
Javascript Tests
----------------
.. note:: Javascript tests has been currently disabled in GeoNode. There is a plan to improve and re-enable them in the future.
.. todo:: Reactivate the js test before