summaryrefslogtreecommitdiff
path: root/tests/test_utils
AgeCommit message (Collapse)Author
2026-03-16Fixed #36859 -- Made assertContains and assertNotContains idempotent for ↵Baptiste Mispelon
streaming responses.
2026-02-26Refs #36936 - Adjusted tests to set PYTHON_COLORS environment variable.Pete Rosenblum
When "FORCE_COLOR" was set in the environment (such as in django-docker-box) several test cases that rely on string comparisons against exception messages or command line results would fail due to ANSI escape sequences being present in the output. This change resolved the issue by setting the "PYTHON_COLORS" environment variable to "0" for those specific tests, which takes precendence over the presence of "FORCE_COLOR".
2026-02-10Added various missing test skips observed on MongoDB.Tim Graham
2026-01-18Applied Black's 2026 stable style.Mariusz Felisiak
https://github.com/psf/black/releases/tag/26.1.0
2025-12-19Fixed #36487 -- Fixed logger error message with partial callbacks.Krishnaprasad MG
2025-09-15Fixed #36589 -- Made assertTemplateUsed/NotUsed track full path for ↵Caitie Baca
PartialTemplate. Previously, assertTemplateUsed only matched partial names, ignoring the template origin. This caused assertions on partials specified by origin ("template.html#partial") to fail. Refs #36410.
2025-08-12Fixed test_utils.tests.HTMLEqualTests.test_parsing_errors following Python's ↵Natalia
HTMLParser fixed parsing. Further details about Python changes can be found in: https://github.com/python/cpython/commit/0243f97cbadec8d985e63b1daec5d1cbc850cae3. Thank you Clifford Gama for the thorough review!
2025-07-18Fixed #35728 -- Computed error messages in assertions only on test failures.Clifford Gama
Performance regression in 1dae65dc63ae84be5002c37b4ddae0b9220e8808. Thanks to Adam Johnson for the report.
2025-06-21Removed @skipIfDBFeature silencing of nonexistent features.Tim Graham
Follow up to f5df7ed7e62585c7d0289a88a327dab8d608efcf.
2025-06-20Removed @skipUnlessDBFeature silencing of nonexistent features.Tim Graham
This was added in 46c7707e50400e237cbd774a31ad801669ca3905 but is obsolete now that gis_tests are discovered separately. It's error-prone to ignore mistyped names.
2025-06-05Fixed #36435 -- Made CaptureQueriesContext restore reset_queries conditionally.Adam Johnson
2025-06-05Refs #36435 -- Tidied tests for CaptureQueriesContext and assertNumQueries.Adam Johnson
Avoided repeatedly templating the URL and hoisted Person creation to setUpTestData in AssertNumQueriesContextManagerTests to repeat the same pattern as in CaptureQueriesContextManagerTests.
2025-05-27Removed redundant redefinition of variable in tests/test_utils/tests.py.Clifford Gama
2025-01-20Fixed #36005 -- Dropped support for Python 3.10 and 3.11.Mariusz Felisiak
2024-11-11Fixed a typo in some tests.yatami38
2024-09-17Fixed #35660 -- Made serialized_rollback and fixture data available in ↵Jacob Walls
TransactionTestCase.setUpClass().
2024-09-17Refs #35660 -- Updated TransactionTestCase methods into class or static methods.Jacob Walls
2024-09-13Closed connection pool in clean up of test_allowed_database_copy_queries.suraj
2024-08-08Fixed #35622 -- Made unittest ignore Django assertions in traceback frames.Adam Johnson
Co-authored-by: Natalia <124304+nessita@users.noreply.github.com>
2024-03-20Fixed ResourceWarning from unclosed SQLite connection in test_utils on ↵Mariusz Felisiak
Python 3.13+. On SQLite, close() doesn't explicitly close in-memory connections. Follow up to 921670c6943e9c532137b7d164885f2d3ab436b8 and dd45d5223b3c5640baefcb591782bbcff873b6bf.
2024-02-26Refs #32114 -- Fixed test crash on non-picklable objects in subtests when ↵David Wobrock
PickleError is raised. Related to the https://github.com/python/cpython/issues/73373. Follow up to c09e8f5fd8f977bf16e9ec5d11b370151fc81ea8.
2024-02-21Fixed #32114 -- Fixed parallel test crash on non-picklable objects in subtests.David Wobrock
2024-02-19Fixed #35226 -- Reallowed executing queries for dynamically created connections.Mariusz Felisiak
Regression in 8fb0be3500cc7519a56985b1b6f415d75ac6fedb. Thanks Florian Apolloner for the report.
2024-02-19Fixed closing connections in test_utils.tests.AllowedDatabaseQueriesTests.Mariusz Felisiak
2024-02-10Refs #34900, Refs #34118 -- Updated assertion in ↵Daniel Garcia Moreno
test_skip_class_unless_db_feature() test on Python 3.12.2+. Python 3.12.2 bring back the skipped tests in the number of running tests. Refs https://github.com/python/cpython/commit/0a737639dcd3b7181250f5d56694b192eaddeef0
2024-01-12Avoided nested transactions in SkippingClassTestCase.Florian Apolloner
2024-01-03Fixed #33277 -- Disallowed database connections in threads in SimpleTestCase.David Wobrock
2023-12-22Fixed #34658 -- Added SimpleTestCase.assertNotInHTML().Nicolas Lupien
2023-10-16Refs #34900, Refs #34118 -- Updated assertion in ↵Mariusz Felisiak
test_skip_class_unless_db_feature() test on Python 3.12.1+. Python 3.12.1+ no longer includes skipped tests in the number of running tests. Check out: https://github.com/python/cpython/issues/110890#issuecomment-1763458686 https://github.com/python/cpython/pull/106588
2023-10-03Fixed #34657 -- Made assert(Not)Contains/assertInHTML display haystacks in ↵Chinmoy Chakraborty
error messages.
2023-10-03Refs #34657 -- Made msg_prefix handling in assertURLEqual()/assertInHTML ↵Mariusz Felisiak
consistent with other assertions. Co-authored-by: Chinmoy Chakraborty <chinmoy12c@gmail.com>
2023-09-29Refs #34657 -- Made assertInHTML() use unparsed needle in error messages.Chinmoy Chakraborty
2023-09-22Fixed #34823 -- Fixed assertTemplateUsed() context manager crash on unnamed ↵Arian
templates.
2023-09-18Refs #33990 -- Removed TransactionTestCase.assertQuerysetEqual() per ↵Mariusz Felisiak
deprecation timeline.
2023-09-18Refs #33990 -- Removed SimpleTestCase.assertFormsetError() per deprecation ↵Mariusz Felisiak
timeline.
2023-07-14Refs #30686 -- Moved Parser.SELF_CLOSING_TAGS to django.utils.html.VOID_ELEMENTSDavid Smith
2023-02-01Refs #33476 -- Applied Black's 2023 stable style.David Smith
Black 23.1.0 is released which, as the first release of the year, introduces the 2023 stable style. This incorporates most of last year's preview style. https://github.com/psf/black/releases/tag/23.1.0
2023-01-18Fixed #34233 -- Dropped support for Python 3.8 and 3.9.Mariusz Felisiak
2023-01-17Refs #33348 -- Removed support for passing response object and form/formset ↵Mariusz Felisiak
name to SimpleTestCase.assertFormError()/assertFormSetError(). Per deprecation timeline.
2023-01-17Refs #33348 -- Removed support for passing errors=None to ↵Mariusz Felisiak
SimpleTestCase.assertFormError()/assertFormsetErrors(). Per deprecation timeline.
2023-01-12Refs #26029 -- Deprecated DEFAULT_FILE_STORAGE and STATICFILES_STORAGE settings.Jarosław Wygoda
2022-11-24Used DatabaseFeatures.django_test_skips to skip ↵Christophe Baldy
AssertNumQueriesUponConnectionTests tests.
2022-10-08Refs #33990 -- Renamed TransactionTestCase.assertQuerysetEqual() to ↵Gregor Gärtner
assertQuerySetEqual(). Co-Authored-By: Michael Howitz <mh@gocept.com>
2022-10-07Refs #33990 -- Renamed SimpleTestCase.assertFormsetError() to ↵Gregor Gärtner
assertFormSetError(). Co-Authored-By: Michael Howitz <mh@gocept.com>
2022-09-06Fixed #33616 -- Allowed registering callbacks that can fail in ↵SirAbhi13
transaction.on_commit(). Thanks David Wobrock and Mariusz Felisiak for reviews.
2022-04-12Fixed #33633 -- Skipped some test_utils tests on databases that don't ↵zhangyangyu
support transactions.
2022-04-07Refs #33173 -- Fixed test_runner/test_utils tests on Python 3.11+.Mariusz Felisiak
Python 3.11 uses fully qualified test name in unittest output. See https://github.com/python/cpython/commit/755be9b1505af591b9f2ee424a6525b6c2b65ce9
2022-04-06Fixed #33348 -- Changed ↵Baptiste Mispelon
SimpleTestCase.assertFormError()/assertFormsetErrors() to take form/formset. Instead of taking a response object and a context name for the form/formset, the two methods now take the object directly.
2022-04-05Moved remaining SimpleTestCase.assertFormError()/assertFormsetErrors() tests ↵Mariusz Felisiak
to test_utils. This also removes redundant tests in test_client_regress. Follow up to 68144f40490b2572c8da4341742b9e387e3f6bdd.
2022-03-08Rewrote some references to "master".Adam Johnson
Following d9a266d657f66b8c4fa068408002a4e3709ee669.