Skip to main content

Provides a Django TransactionTestCase.assertMaxNumQueries(), analogous to the existing TransactionTestCase.assertNumQueries()

Project description

Django AssertMaxNumQueries

https://img.shields.io/pypi/v/django-assertmaxnumqueries.svg https://img.shields.io/travis/prismaticd/django-assertmaxnumqueries.svg Documentation Status Updates
Provides a mixin and TransactionTestCase subclass with assertMaxNumQueries(),

analogous to django.test.TransactionTestCase.assertNumQueries

Usage

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")

Credits

This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.

History

0.1.0 (2017-12-11)

  • First release on PyPI.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django_assertmaxnumqueries-0.1.2.tar.gz (14.6 kB view hashes)

Uploaded Source

Built Distribution

django_assertmaxnumqueries-0.1.2-py2.py3-none-any.whl (4.6 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page