--- id: django-webtest version: "1.9.14" license: MIT license license_treatment: permissive maintenance: aging --- # django-webtest — Instant integration of Ian Bicking's WebTest (http://docs.pylonsproject.org/projects/webtest/) with Django's testing framework. License: permissive · Maintenance: aging · Downloads: 263.3K/mo ## What it is and what it does django-webtest wraps Ian Bicking's WebTest library to provide a Django TestCase subclass that creates a test application around Django's WSGI interface. It bridges the gap between Django's native test client—which is designed primarily to inspect rendered templates and context—and functional/integration testing frameworks like WebTest, which simulate real HTTP interactions. The package exposes WebTest's API through a `self.app` object in test cases, with added conveniences: a `user` argument for authenticated requests, automatic CSRF token handling in form submissions, access to `response.templates` and `response.context`, and support for Django's native test assertions. It also integrates with django-rest-framework's authentication system and provides pytest fixtures when pytest-django is installed. Use it for: - Write functional tests that follow links, submit forms, and verify HTML responses without mocking the request layer - Test form submission workflows with automatic CSRF token handling and field population - Verify template rendering and context data in integration tests that exercise the full request/response cycle - Test authenticated user flows by passing a user object or username to requests - Test django-rest-framework endpoints with automatic authentication integration ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Integrates WebTest with Django's testing framework to enable functional and integration testing via WSGI, providing access to rendered templates, context, and form handling without suppressing CSRF checks by default. Yes, if you need functional or integration testing for Django applications. The package is stable, permissively licensed, and has low install friction. The aging maintenance status (312 days since release) is a minor concern but not a blocker given the package's Production/Stable classification and active repository. Install it when Django's native test client is insufficient for your testing needs. ## Install pip install django-webtest uv add django-webtest poetry add django-webtest ## Installing django-webtest Before you install: Low friction install with a single runtime dependency (webtest). Maintenance status is aging—last release was 312 days ago—but the repository remains active and the package is marked Production/Stable with support for Django 4.2, 5.0, 5.1, and 5.2. License in practice: MIT license (permissive) imposes no restrictions on use, modification, or distribution in commercial or private projects. Quickstart: pip install django-webtest from django_webtest import WebTest class MyTestCase(WebTest): def test_page(self): response = self.app.get('/', user='username') assert 'Expected text' in response Verify before relying: - Whether the aging maintenance status (312 days since last release) affects compatibility with the latest Django patch versions - Performance characteristics when testing large or complex Django applications ## Package facts - License: MIT license (permissive) - Python support: unspecified - Install friction: low - Maintenance: aging - Downloads: 263.3K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags django functional testing, webtest django integration, django wsgi test client, django form testing, django integration testing, django-testing, wsgi-testing, functional-testing [View on SkillFed](https://skillfed.io/packages/django-webtest) · [View on PyPI](https://pypi.org/project/django-webtest/)