Registry / testing / django-test-plus

django-test-plus

JSON →
library2.4.1pypypiunverified

Useful additions to Django's default TestCase, such as shortcut assertions and improved request factory. Current version is 2.4.1, updated 2025-03, maintained by REVSYS. Release cadence is irregular, roughly 1-2 minor versions per year.

pip install django-test-plus
INSTALL
IMPORT
SIG · DJANGO-TEST-PLUS
D
django-test-plus
testingpythonv2.4.1
Install
2.4s avg
Import
—
Disk
17MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v2.4.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 18.7MB
glibc
py 3.10–3.95 runs
installs and imports cleanly · install 2.4s · import 0.000s · 19MB
17MB installed
● package 17MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

TestCase
✓ from test_plus import TestCase
✗ from test_plus import TestCase

Subclass `test_plus.TestCase` to get additional assertions like `assert_200`, `assert_contains`, `get_check_200`, and improved request factory.

from test_plus import TestCase class MyViewTest(TestCase): def test_get(self): response = self.client.get('/my-view/') self.assert_200(response) self.assert_contains(response, 'Hello')
Debug
Known issues
breakingIn v2.0, support for Django < 3.2 and Python < 3.6 was dropped. Also, the `reverse()` method no longer automatically appends trailing slashes; you must include them explicitly.
fix
Upgrade to Django >= 3.2 and Python >= 3.6. Ensure your URLs include trailing slashes where expected.
affects: <2.0
deprecatedThe `TransactionTestCase` class from `test_plus` is deprecated in favor of using Django's built-in `TransactionTestCase` or the `test_plus.TestCase` with appropriate database settings.
fix
Use `django.test.TransactionTestCase` or `test_plus.TestCase` with `transaction=True`.
affects: >=2.0
gotchaThe `get_check_200` method (and similar) calls `self.client.get()` which does not follow redirects. If your view redirects, you need to use `self.client.get()`, `assert_redirects()` manually.
fix
For views that redirect, use `self.client.get(url, follow=True)` or check redirect status explicitly with `assert_302` or `assert_redirects`.
affects: all
Upgrade
Version history
2.4.1latest on PyPI · released Dec 19, 2025
Audit
Dependencies
djangorequiredCore dependency, provides test infrastructure.
Agent activity
27 hits · last 30 days
node
24
Resources
django-test-plus — pip install django-test-plus · libregistry