Skip to content
Arona Jones edited this page Feb 4, 2021 · 1 revision

PyRIGS currently uses a combination of Django TestCase and django-pytest.

Some of the usual assumptions get thrown out of the window testing RIGS. These are 1. Tests should not often rely on the database and 2. Unit tests first, integration tests second. (and 3. Tests should not care about order, see section on transactions)

PyRIGS at its heart is a simple CRUD app, the complexity (such as it is) is in the UI/UX, hence the need for integration > unit tests.

Transactional vs Non-Transactional Database Tests

Transactional tests drop the database between tests, otherwise the database state is conserved, with test effects rolled back each time.

Because of this, order becomes important in tests. Django by default runs transactional tests last, and django-pytest mimics this behaviour.

Clone this wiki locally