Skip to main content
https://github.com/yourlabs/django-responsediff/actions/workflows/ci.yml/badge.svg https://codecov.io/github/yourlabs/django-responsediff/coverage.svg?branch=master https://badge.fury.io/py/django-responsediff.png

django-responsediff

I’m pretty lazy when it comes to writing tests for existing code, however, I’m even lazier when it comes to repetitive manual testing action.

This package aims at de-duplicating view tests inside the political-memory itself and to make it reusable for other apps.

It’s pretty much the same as django-dbdiff, except this is for HTTP response.

Response state assertion

When my user tests, he browses the website and checks that everything is rendered fine. This app allows to do high-level checks of HTML rendering.

See responsediff/response.py docstrings for example usage, or use the conveniance mixin:

from responsediff.test import ResponseDiffTestMixin

class MixinTest(ResponseDiffTestMixin, test.TestCase):
    def test_admin(self):
        self.assertResponseDiffEmpty(test.Client().get('/admin/'))

The above will fail on the first time with FixtureCreated to indicate that it has written responsediff/tests/response_fixtures/MixinTest.test_admin/{content,status_code}. This file is meant to be added to version control. So next time this will run, it will check that response.status_code and response.content is the same, in future version, or in other configurations.

Instead of deleting the fixtures manually before running the tests to regenerate them, just run your tests with FIXTURE_REWRITE=1 environment variable. This will overwrite the fixtures and make the tests look like they passed.

You can also use assertWebsiteSame to crawl your site automatically:

class SiteTest(ResponseDiffTestMixin, test.TestCase):
    def test_site(self):
        self.assertWebsiteSame()

Requirements

Python 3.10 through 3.14 and Django 4.2 (LTS), 5.2 (LTS), and 6.0 are supported. Install with pip:

pip install django-responsediff

Metadata

Release files for django-responsediff 0.9.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-responsediff 0.9.0
File Size Uploaded Provenance Actions
django_responsediff-0.9.0.tar.gz 11.3 kB Without provenance Details for django_responsediff-0.9.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for django-responsediff 0.9.0
File Interpreter ABI Platform Actions
django_responsediff-0.9.0-py3-none-any.whl Python 3 none any Details for django_responsediff-0.9.0-py3-none-any.whl

Total release size: 29.6 kB

Release files / django_responsediff-0.9.0.tar.gz

Download URL django_responsediff-0.9.0.tar.gz
Size 11.3 kB
Tags Source
SHA-256 checksum
How to use checksums
c2e7b8e9e4a421a50d41ccf4c61fd3ae3ce28dcebe3230a4444e34689ceb10e9
BLAKE2b-256 checksum
How to use checksums
5afe6d2b2c7b186c726be431c5987f5317f87ad75cfabb541b134646064a7283
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.4

Release files / django_responsediff-0.9.0-py3-none-any.whl

Download URL django_responsediff-0.9.0-py3-none-any.whl
Size 18.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fd1d98cea23c3f2366f17e5b3a725866bde8ccffaaec133a045d2b07d91abc17
BLAKE2b-256 checksum
How to use checksums
d7a4d78406fd2e8b133bac40584fa66381c84ecfb148202cb2eb58660e4cc85d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.4

Security for django-responsediff 0.9.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page