- Provides a mixin and TransactionTestCase subclass with assertMaxNumQueries(),
- analogous to django.test.TransactionTestCase.assertNumQueries
- Free software: MIT license
- Documentation: https://django-assertmaxnumqueries.readthedocs.io.
Usage is identical to django.test.TransactionTestCase.assertNumQueries , except check on the number of queries is assertLessEqual insert of assertEqual.
To use Django AssertMaxNumQueries in a project:
import django_assertmaxnumqueries class MyTestCase(django_assertmaxnumqueries.TransactionTestCase): def test_my_test(self): with self.assertMaxNumQueries(2): Person.objects.create(name="Aaron") Person.objects.create(name="Daniel")
This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.