skillfed

django-test-plus

django-test-plus provides useful additions to Django's default TestCase

django-test-plus v2.6.2 135.8K downloads/30d#11,417 on PyPI632
Permissive license Active released

What it is and what it does

django-test-plus is a TestCase subclass for Django that bundles common testing patterns into helper methods, cutting down on repetitive test code. Instead of manually reversing URLs, checking response status codes, and inspecting context dictionaries, you call methods like `get()`, `response_200()`, and `assertInContext()`. It also provides utilities for user creation, login context managers, query count assertions, and a pytest fixture that exposes the same helpers for pytest-style tests.

The package is designed for teams writing Django tests who want to move faster. It works with Django 4.2 LTS, 5.1, 5.2 LTS, 6.0, and 6.1, and Python 3.10, 3.11, 3.12, 3.13, 3.14, and 3.15, including free-threaded builds. No external runtime dependencies means installation is straightforward and the package integrates directly into your existing Django test suite.

Use it for:

  • Speed up view testing by chaining GET/POST calls with status assertions in one line
  • Test authentication flows with login context managers and assertLoginRequired helpers
  • Create test users quickly instead of manually instantiating and saving User objects
  • Assert query counts to catch N+1 problems early with query count assertion methods
  • Use pytest fixtures to access the same helpers in pytest-style tests alongside Django's test framework
  • Build project-specific test base classes by subclassing and adding custom helpers

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Provides a TestCase subclass for Django with helper methods to reduce boilerplate when writing tests for views, models, and authentication, including shortcuts for URL reversal, status code assertions, and user creation.

Yes. django-test-plus is actively maintained, has no dependencies, and is widely used. It directly reduces test boilerplate for any Django project using the standard test framework or pytest, with no compatibility risk and permissive licensing. Install it if your team writes Django tests.

Install

django-test-plus on PyPI

pip

pip install django-test-plus

uv

uv add django-test-plus

poetry

poetry add django-test-plus

Installing django-test-plus

Before you install

Low friction install with no runtime dependencies. Actively maintained with a recent release and steady repository activity; supports current Python versions and modern Django versions.

License in practice

Licensed under BSD (permissive), so you can use, modify, and distribute the package freely in commercial and open-source projects without restriction.

Quickstart

pip install django-test-plus

from test_plus.test import TestCase

class MyViewTests(TestCase):
    def test_view(self):
        self.get('my-url-name')
        self.response_200()
        self.assertInContext('some-key')

Verify before relying

  • Exact monthly download volume and ranking position to confirm popularity tier claims
  • Whether the package is compatible with Django 5.0 (classifiers list 5.0 but description does not)

Package facts

License not declared (permissive)
Python support supports the current Python release (>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies none
Maintenance actively maintained — 12 days since the last release
Last repo commit
First released
Downloads 135,801/month — #11,417 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: django_test_plus-2.6.2-py3-none-any.whl

Development Status :: 5 - Production/StableEnvironment :: Web EnvironmentFramework :: DjangoFramework :: Django :: 4.2Framework :: Django :: 5.0Framework :: Django :: 5.1Framework :: Django :: 5.2Framework :: Django :: 6.0Framework :: Django :: 6.1Framework :: PytestIntended Audience :: DevelopersLicense :: OSI Approved :: BSD LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.15Programming Language :: Python :: Free Threading :: 3 - Stable

Tags

django test helpersreduce django test boilerplatedjango testcase shortcutsdjango view testing utilitiesdjango authentication test helpersdjango query count assertionspytest fixtures for django
django-testingtest-utilitiespytest-compatible

More Testing packages