Metadata-Version: 2.1
Name: anfema-django-testutils
Version: 0.2.0
Summary: Testrunner for django which covers html report and code coverage
Keywords: django,tests,coverage,testrunner
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Classifier: Framework :: Django
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Requires-Dist: django-mathfilters
Requires-Dist: coverage[toml]
Requires-Dist: snapshottest
Requires-Dist: black ; extra == "dev"
Requires-Dist: isort ; extra == "dev"
Requires-Dist: sphinx~=5.1 ; extra == "docs"
Requires-Dist: sphinx-autodoc-typehints ; extra == "docs"
Requires-Dist: sphinx_rtd_theme ; extra == "docs"
Requires-Dist: sphinx-copybutton ; extra == "docs"
Requires-Dist: m2r2 ; extra == "docs"
Project-URL: Source, https://github.com/anfema/anfema-django-testutils
Provides-Extra: dev
Provides-Extra: docs

# anfema-django-testutils
The main intention of the `anfema_django_testutils` app is to provide a Django test runner which considers
snapshot tests as well as code coverage and human-readable html test reports. Moreover, the test result 
`Precondition Failure` has been added.

This package integrates [snapshottest](https://github.com/syrusakbary/snapshottest) as well as 
[coverage](https://coverage.readthedocs.io/en/latest/).

`anfema_django_testutils` is supported on:
- Python >= 3.9

Source available at: https://github.com/anfema/anfema-django-testutils

## Installation
```bash
$ pip install anfema-django-testutils
```
## Setting up

Update your Django `settings.py` to use the `anfema_django_testutils` test runner:
```python
# settings.py

INSTALLED_APPS = [
    ...
    "mathfilters",
    "anfema_django_testutils",
]

TEST_RUNNER = "anfema_django_testutils.runner.TestRunner"
```

For further information see the `anfema_django_testutils` documentation.

## Usage
For writing test cases use the `anfema_django_testutils.testcases.TestCase` rather than the `django.test.TestCase`:

```python
# app/tests.py

from anfema_django_testutils.testcases import TestCase


class CustomTest(TestCase):
    ...
```

## Create documentation
To generate the `anfema_django_testutils` documentation from the local sources, run in a terminal:

```bash
$ pip install tox
```

```bash
$ tox -e docs -- docs/build
```

## License
Licensed under the MIT-clause license; see `LICENSE` for details.

