Skip to main content

Extensions for using inline-snapshot to test Django projects.

Project description

https://img.shields.io/github/actions/workflow/status/adamchainz/inline-snapshot-django/main.yml.svg?branch=main&style=for-the-badge https://img.shields.io/badge/Coverage-100%25-success?style=for-the-badge https://img.shields.io/pypi/v/inline-snapshot-django.svg?style=for-the-badge https://img.shields.io/badge/code%20style-black-000000.svg?style=for-the-badge pre-commit

Extensions for using inline-snapshot to test Django projects.

A quick example:

from django.test import TestCase
from inline_snapshot import snapshot
from inline_snapshot_django import snapshot_queries

class IndexTests(TestCase):
    def test_success(self):
        with snapshot_queries() as snap:
            response = self.client.get("/")
        assert snap == snapshot(
            [
                "SELECT ... FROM auth_user WHERE ...",
                "SELECT ... FROM example_character WHERE ...",
            ]
        )

inline-snapshot will automatically capture and update the contents of snapshot(), allowing you to quickly write and maintain tests that demonstrate the structure of your queries.

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

inline_snapshot_django-1.0.0.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

inline_snapshot_django-1.0.0-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

Details for the file inline_snapshot_django-1.0.0.tar.gz.

File metadata

  • Download URL: inline_snapshot_django-1.0.0.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for inline_snapshot_django-1.0.0.tar.gz
Algorithm Hash digest
SHA256 4c87b1784cc849bde6d3127b52a5fda9a254702846ac2ab7ddb82d362a5b9589
MD5 71aca6fa1ef9570f825c6d01605a50e5
BLAKE2b-256 c1985c7f2befc510ac64041249e1b544a7bb0aacd89a062028fba38e5ef48d0b

See more details on using hashes here.

Provenance

The following attestation bundles were made for inline_snapshot_django-1.0.0.tar.gz:

Publisher: main.yml on adamchainz/inline-snapshot-django

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file inline_snapshot_django-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for inline_snapshot_django-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1c3a72871201e0ab27b832211fc7fef9bc14c8f3a225e8584a408c682ede78d2
MD5 c1796e1efa39c7b208e48359a4cdbe90
BLAKE2b-256 1caccac60a811261203dbe2e28f017ac85410326a5747ad23f3b0a27e52c856a

See more details on using hashes here.

Provenance

The following attestation bundles were made for inline_snapshot_django-1.0.0-py3-none-any.whl:

Publisher: main.yml on adamchainz/inline-snapshot-django

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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