Skip to content

Running tests for the back end

amplifi edited this page Jun 29, 2017 · 1 revision

Backend tests are written and executed using pytest and Django's test framework.

We recommend running the tests from inside your Virtual Machine using the virtualenv provided. Before running the tests, you'll need to SSH into to the Virtual Machine and activate the virtualenv:

vagrant ssh
cd /vagrant/
source /opt/cadasta/env/bin/activate

To run the tests from the repository's root:

py.test cadasta

To get coverage reports run:

py.test cadasta --cov=cadasta  --cov-report=html

This creates a HTML report under htmlcov. See pytest-cov docs for other report formats.

Clone this wiki locally