{"id":21168,"library":"django-test-plus","title":"django-test-plus","description":"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.","status":"active","version":"2.4.1","language":"python","source_language":"en","source_url":"https://github.com/revsys/django-test-plus/","tags":["django","testing","test-case","assertions","utilities"],"install":[{"cmd":"pip install django-test-plus","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Core dependency, provides test infrastructure.","package":"django","optional":false}],"imports":[{"wrong":"from test_plus import TestCase","symbol":"TestCase","correct":"from test_plus import TestCase"}],"quickstart":{"code":"from test_plus import TestCase\n\nclass MyViewTest(TestCase):\n    def test_get(self):\n        response = self.client.get('/my-view/')\n        self.assert_200(response)\n        self.assert_contains(response, 'Hello')","lang":"python","description":"Subclass `test_plus.TestCase` to get additional assertions like `assert_200`, `assert_contains`, `get_check_200`, and improved request factory."},"warnings":[{"fix":"Upgrade to Django >= 3.2 and Python >= 3.6. Ensure your URLs include trailing slashes where expected.","message":"In 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.","severity":"breaking","affected_versions":"<2.0"},{"fix":"Use `django.test.TransactionTestCase` or `test_plus.TestCase` with `transaction=True`.","message":"The `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.","severity":"deprecated","affected_versions":">=2.0"},{"fix":"For views that redirect, use `self.client.get(url, follow=True)` or check redirect status explicitly with `assert_302` or `assert_redirects`.","message":"The `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.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"search_vec":"'-03':26 '-2':36 '1':35 '2.4.1':23 '2025':25 'addit':6 'assert':15,46 'cadenc':31 'case':45 'current':20 'default':10 'django':2,8,41 'django-test-plus':1 'factori':19 'improv':17 'irregular':33 'maintain':27 'minor':37 'per':39 'plus':4 'releas':30 'request':18 'revsi':29 'rough':34 'shortcut':14 'test':3,42,44 'test-cas':43 'testcas':11 'updat':24 'use':5 'util':47 'version':21,38 'year':40","created_at":"2026-04-27T16:58:26.765989+00:00","updated_at":"2026-04-27T16:58:26.765989+00:00","problems":{"verify_error":"Traceback (most recent call last):\n  File \"<string>\", line 1, in <module>\n  File \"/tmp/tmpa9ockq3j/venv/lib/python3.12/site-packages/test_plus/__init__.py\", line 1, in <module>\n    from .test import APITestCase, TestCase\n  File \"/tmp/tmpa9ockq3j/venv/lib/python3.12/site-packages/test_plus/test.py\", "},"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"2.4.1","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/revsys/django-test-plus","docs":null,"changelog":"https://github.com/revsys/django-test-plus/blob/main/CHANGELOG.md","pypi":"https://pypi.org/project/django-test-plus/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["testing","web-framework"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"import_fail","verified_at":"2026-07-03","last_verified":"2026-07-03","next_check":"2026-07-10","install_tag":null}}