Test

Testing is managed by pytest and tox.

Before run install, you need install required packages for testing:

$ pip install -r requirements-dev.txt

Run Test

To run testing on locally:

$ py.test

To run testing on locally with code coverage:

$ py.test --cov-report=html --cov=django_cas_ng
...
...
Coverage HTML written to dir htmlcov

To run all testing on all environments locally:

$ tox

tox.ini - tox Configuration Reference

[tox]
envlist=
    py{36,37,38}-django22
    py{36,37,38}-django30
    py{36,37,38}-django31
    py{36,37,38,39,310}-django32
    py{38,39,310}-django40
    py{38,39,310}-djangomaster
    flake8

[flake8]
# E402 module level import not at top of file
# E501 line too long
ignore = E501

[testenv]
deps =
    django22: Django>=2.2,<3.0
    django30: Django>=3.0,<3.1
    django31: Django>=3.1,<3.2
    django32: Django>=3.2,<3.3
    django40: Django>=4.0,<4.1
    djangomaster: https://github.com/django/django/archive/main.tar.gz
    pytest
    pytest-cov
    pytest-django
    pytest-pythonpath
commands=py.test --cov-report term-missing --cov django_cas_ng --tb native {posargs:tests}

[testenv:flake8]
deps=flake8
commands=flake8
skip_install = true

[testenv:isort]
deps = isort
commands = isort --check-only --diff django_cas_ng
skip_install = true

Tests Module Reference