| Age | Commit message (Collapse) | Author | |
|---|---|---|---|
| 2025-02-16 | [5.2.x] Fixed #35967 -- Deferred test suite fixtures serialization after all ↵ | Simon Charette | |
| dbs setup. While the top-level objects fed to serialization are bound to the test database being created nothing prevents code invoked during serialization from performing queries against other connections entries that haven't been swapped yet. The reported example of that is a database router directing all reads to a test mirror for a set of models involving auto-created many-to-many fields. It might be tempting to address the many-to-many field case but this a symptom of a larger problem where the test framework yields the flow execution to user code that could interact with non-test databases in unexpected ways. Deferring test database fixture serialization until the point where all connections entries have been swapped for their test equivalent ensures that no code triggered during serialization can interact with non-test databases. Thanks Jake Howard for the report and Jacob Walls for the initial investigation. Backport of dc69a63f844b2ef3bc3371edde91644cf0bef0ee from main | |||
| 2023-12-06 | Refs #34986 -- Moved garbage_collect() helper to django.test.utils. | Nick Pope | |
| 2023-07-27 | Fixed typo in django/test/utils.py. | Bruno Alla | |
| 2023-01-17 | Refs #32446 -- Removed SERIALIZE test database setting per deprecation timeline. | Mariusz Felisiak | |
| 2022-12-20 | Refs #34118 -- Adopted asgiref coroutine detection shims. | Carlton Gibson | |
| Thanks to Mariusz Felisiak for review. | |||
| 2022-10-31 | Used more augmented assignment statements. | Nick Pope | |
| Identified using the following command: $ git grep -I '\(\<[_a-zA-Z0-9]\+\>\) *= *\1 *[-+/*^%&|<>@]' | |||
| 2022-02-07 | Refs #33476 -- Refactored code to strictly match 88 characters line length. | Mariusz Felisiak | |
| 2022-02-07 | Refs #33476 -- Reformatted code with Black. | django-bot | |
| 2022-01-25 | Refs #20349 -- Avoided loading testing libraries when not needed. | Collin Anderson | |
| 2021-06-29 | Refs #32655 -- Improved error if iter_test_cases() is passed a string. | Chris Jerdonek | |
| 2021-03-11 | Refs #32489 -- Doc'd and tested iter_test_cases() support for an iterable of ↵ | Chris Jerdonek | |
| tests. | |||
| 2021-03-09 | Fixed #32516 -- Fixed reorder_suite() with duplicates and reverse=True. | Chris Jerdonek | |
| 2021-03-05 | Fixed #32489 -- Added iter_test_cases() to iterate over a TestSuite. | Chris Jerdonek | |
| This also makes partition_suite_by_type(), partition_suite_by_case(), filter_tests_by_tags(), and DiscoverRunner._get_databases() to use iter_test_cases(). | |||
| 2021-02-24 | Fixed #32446 -- Deprecated SERIALIZE test database setting. | Simon Charette | |
| Whether or not the state of a test database should be serialized can be inferred from the set of databases allowed to be access from discovered TestCase/TransactionTestCase enabling the serialized_rollback feature which makes this setting unnecessary. This should make a significant test suite bootstraping time difference on large projects that didn't explicitly disable test database serialization. | |||
| 2021-02-24 | Refs #31811 -- Restored **kwargs to django.test.utils.setup_databases(). | Mariusz Felisiak | |
| Accidentally removed in 61a0ba43cfd4ff66f51a9d73dcd8ed6f6a6d9915. | |||
| 2021-02-16 | Fixed #29052 -- Made test database creation preserve alias order and prefer ↵ | Harm Geerts | |
| the "default" database. This fixes flushing test databases when two aliases point to the same database. Use a list() to store the test database aliases so the order remains stable by following the order of the connections. Also, always use the "default" database alias as the first alias to accommodate `migrate`. Previously `migrate` could be executed on a secondary alias which caused truncating the "default" database. | |||
| 2020-09-07 | Fixed #31944 -- Used addCleanup() to register TestContextDecorator cleanups. | François Freitag | |
| Cleanups from addCleanup() are scheduled to happen in reverse order to the order they are added (LIFO). Ensures each cleanup is executed from the innermost to the outermost. | |||
| 2020-09-03 | Fixed #31979 -- Made django.test.utils.setup_databases()'s time_keeper ↵ | Jon Dufresne | |
| argument optional. | |||
| 2020-08-14 | Added missing items to django.test.client.__all__ and django.test.utils.__all__. | Mads Jensen | |
| 2020-08-13 | Refs #31811 -- Added optional timing outputs to the test runner. | Ahmad A. Hussein | |
| 2020-03-18 | Fixed #31224 -- Added support for asynchronous views and middleware. | Andrew Godwin | |
| This implements support for asynchronous views, asynchronous tests, asynchronous middleware, and an asynchronous test client. | |||
| 2020-02-13 | Fixed #31250 -- Ignored processing instructions in ↵ | yura | |
| assertXMLEqual()/assertXMLNotEqual(). | |||
| 2019-12-04 | Removed unnecessary dict.get() call in favor of direct indexing. | Jon Dufresne | |
| The 'TEST' key is always set to a dictionary in ConnectionHandler. | |||
| 2019-05-24 | Fixed #30497 -- Ignored document type in assertXMLEqual()/assertXMLNotEqual(). | Caio Ariede | |
| 2019-04-24 | Removed unnecessary assignments in various code. | Jon Dufresne | |
| 2019-02-06 | Fixed #30159 -- Removed unneeded use of OrderedDict. | Nick Pope | |
| Dicts preserve order since Python 3.6. | |||
| 2019-02-05 | Refs #27753 -- Removed django.test.utils.patch_logger() and str_prefix(). | Tim Graham | |
| 2019-01-10 | Fixed #28478 -- Make DiscoverRunner skip creating unused test databases. | Simon Charette | |
| SimpleTestCase.databases makes it possible to determine the set of databases required to run the discovered tests. | |||
| 2018-11-25 | Fixed typo in patch_logger() docstring. | takaaki shimbo | |
| 2018-09-28 | Refs #28909 -- Simplifed code using unpacking generalizations. | Sergey Fedoseev | |
| 2018-08-21 | Fixed #29658 -- Registered model lookups in tests with a context manager. | Srinivas Reddy Thatiparthy (శ్రీనివాస్ రెడ్డి తాటిపర్తి) | |
| 2018-08-17 | Fixed #29024 -- Made TestContextDecorator call disable() if setUp() raises ↵ | Kamil | |
| an exception. | |||
| 2018-07-30 | Fixed #29467 -- Made override_settings handle errors in setting_changed ↵ | Sławek Ehlert | |
| signal receivers. | |||
| 2018-06-12 | Restored django.test.utils.patch_logger() for backwards compatibility. | Jon Dufresne | |
| Added back after 607970f31cc07c317f2ebb684c8f3ccc36a95b3e. | |||
| 2018-05-07 | Replaced django.test.utils.patch_logger() with assertLogs(). | Claude Paroz | |
| Thanks Tim Graham for the review. | |||
| 2018-01-08 | Fixed #28869 -- Made tagged test classes and methods inherit tags from parents. | Will Ayd | |
| 2018-01-03 | Fixed #28982 -- Simplified code with and/or. | Дилян Палаузов | |
| 2017-12-26 | Fixed #28930 -- Simplified code with any() and all(). | Дилян Палаузов | |
| 2017-12-11 | Fixed #28909 -- Simplified code using tuple/list/set/dict unpacking. | Nick Pope | |
| 2017-12-06 | Fixed #28893 -- Removed unnecessary dict.items() calls. | Tim Graham | |
| 2017-09-11 | Fixed #28578 -- Renamed DatabaseCreation number arguments to suffix. | Jon Dufresne | |
| 2017-08-24 | Used sets for CheckRegistry.registered_checks and deployment_checks. | Sergey Fedoseev | |
| 2017-08-21 | Removed need for hasattr(check, 'tags') in CheckRegistry. | Sergey Fedoseev | |
| It was needed to pass tests because registered checks weren't properly mocked. | |||
| 2017-05-18 | Fixed #28203 -- Ignored connection configuration queries in assertNumQueries(). | François Freitag | |
| 2017-04-27 | Removed obsolete django.test.utils.strip_quotes(). | Tim Graham | |
| Django's test runners no longer discover doctests. | |||
| 2017-04-27 | Replaced set |= operator with update() to avoid temporary set. | Jon Dufresne | |
| 2017-03-04 | Refs #27656 -- Updated remaining docstring verbs according to PEP 257. | Anton Samarchyan | |
| 2017-02-24 | Fixed #27873 -- Fixed crash in setup_test_environment() if ALLOWED_HOSTS is ↵ | Chris Lamb | |
| a tuple. Regression in 17e661641ddaf8266e7430d83cfb2039abc55df7 | |||
| 2017-01-26 | Refs #23919, #27778 -- Removed obsolete mentions of unicode. | Vytis Banaitis | |
| 2017-01-25 | Refs #23919 -- Replaced super(ClassName, self) with super(). | chillaranand | |
