CALC provides a custom Django management command to run all linters and tests:
docker-compose run app python manage.py ultratest
Python unit tests¶
To run just unit tests:
docker-compose run app py.test
For more information on running only specific tests, see
py.test Usage and Invocations.
Some tests use Selenium/WebDriver with Chrome and ChromeDriver to ensure that the back-end and front-end integrate properly. The following environment variables may be useful when configuring these tests:
WD_CHROME_ARGSare command-line flags to pass to Chrome, e.g.
--headless --no-sandbox --disable-setuid-sandbox.
TEST_WITH_ROBOBROWSERis a boolean that indicates whether to run some integration tests using RoboBrowser instead of Selenium/WebDriver. Running tests with RoboBrowser can be much faster and less error-prone than via Selenium, but it also means that the tests are less end-to-end.
SKIP_STATIC_ASSET_BUILDINGis a boolean that indicates whether to skip the building of front-end static assets before running any integration tests. This can be useful if you need to fix a broken test that doesn’t require changing any front-end assets.