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

Uploaded Source

Built Distribution

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

Uploaded Python 2 Python 3

File details

Details for the file django_assertmaxnumqueries-0.1.2.tar.gz.

File metadata

File hashes

Hashes for django_assertmaxnumqueries-0.1.2.tar.gz
Algorithm Hash digest
SHA256 30ce4102b54c4e33498392ab0ac37b558613285126aff1b098db174e3df6bf2b
MD5 7d56528745f54b15c08a9fb6705095a2
BLAKE2b-256 0c73882f39136cc4abe839880ba51360c437d482ed0eca3b1375a834a73cecaa

See more details on using hashes here.

File details

Details for the file django_assertmaxnumqueries-0.1.2-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for django_assertmaxnumqueries-0.1.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 324d45ced5a785a5e5fcb03bd0e5e790141ad35c98533b2ab0ad7e99e1428560
MD5 0571f28e179170ee27f43a2742ed6449
BLAKE2b-256 54cfc9b0e182fb9579e90dd742d347d12a7ae62a7e0679eaf8ad278d05886a2f

See more details on using hashes here.

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