-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
index.txt
86 lines (46 loc) · 2.72 KB
/
index.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
.. _geonode_testing:
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).
.. 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 testcase 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