This repository has been archived by the owner on Apr 15, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
3. Setting Up CKAN: Testing
Jessica Good edited this page Aug 13, 2014
·
7 revisions
Directions below adapted from the Testing CKAN docs and Testing CKAN 2.2 docs.
$ . ckanenv/bin/activate
(ckanenv) $ pip install -r ckanenv/src/ckan/dev-requirements.txt
(ckanenv) $ cd ckanenv/src/ckan
(ckanenv) $ sudo -u postgres createdb -O ckan_user ckan_test -E utf-8
(ckanenv) $ sudo -u postgres createdb -O ckan_user datastore_test -E utf-8
(ckanenv) $ paster datastore set-permissions postgres -c test-core.ini
In test-core.ini change:
sqlalchemy.url = postgresql://ckan_user:ckan_user@localhost/ckan_test
ckan.datastore.write_url = postgresql://ckan_user:password@localhost/datastore_test
ckan.datastore.read_url = postgresql://datastore_reader:password@localhost/datastore_test
ckan.storage_path = /home/ngds/ckanenv/uploaded-files-test
To run CKAN core (ckan) tests and ckan extensions (ckanext) tests:
$ nosetests --ckan --with-pylons=test-core.ini ckan ckanext
Running tests individually. With core ckan the following tests can be run individually: datapusher - datastore - example_iauthfunctions - example_itemplatehelpers - example_theme - multilingual - pdfpreview - reclinepreview - resourceproxy - stats - textpreview
$ nosetests --ckan --with-pylons=test-core.ini ckanext/pdfpreview
By default the tests will keep the database between test runs. If you wish to drop and reinitialize the database before the run you can use the reset-db option:
$ nosetests --ckan --reset-db --with-pylons=test-core.ini ckan