summaryrefslogtreecommitdiff
path: root/django/test/utils.py
AgeCommit message (Collapse)Author
2021-02-24[3.2.x] Refs #31811 -- Restored **kwargs to django.test.utils.setup_databases().Mariusz Felisiak
Accidentally removed in 61a0ba43cfd4ff66f51a9d73dcd8ed6f6a6d9915. Backport of c8837322e8b4068441ffe5dd497ab8a323525d3a from master
2021-02-16[3.2.x] Fixed #29052 -- Made test database creation preserve alias order and ↵Harm Geerts
prefer 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. Backport of 06e5f7ae1639f1e275e7cc1076dc70ca3ebaa946 from master
2020-09-07Fixed #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-03Fixed #31979 -- Made django.test.utils.setup_databases()'s time_keeper ↵Jon Dufresne
argument optional.
2020-08-14Added missing items to django.test.client.__all__ and django.test.utils.__all__.Mads Jensen
2020-08-13Refs #31811 -- Added optional timing outputs to the test runner.Ahmad A. Hussein
2020-03-18Fixed #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-13Fixed #31250 -- Ignored processing instructions in ↵yura
assertXMLEqual()/assertXMLNotEqual().
2019-12-04Removed unnecessary dict.get() call in favor of direct indexing.Jon Dufresne
The 'TEST' key is always set to a dictionary in ConnectionHandler.
2019-05-24Fixed #30497 -- Ignored document type in assertXMLEqual()/assertXMLNotEqual().Caio Ariede
2019-04-24Removed unnecessary assignments in various code.Jon Dufresne
2019-02-06Fixed #30159 -- Removed unneeded use of OrderedDict.Nick Pope
Dicts preserve order since Python 3.6.
2019-02-05Refs #27753 -- Removed django.test.utils.patch_logger() and str_prefix().Tim Graham
2019-01-10Fixed #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-25Fixed typo in patch_logger() docstring.takaaki shimbo
2018-09-28Refs #28909 -- Simplifed code using unpacking generalizations.Sergey Fedoseev
2018-08-21Fixed #29658 -- Registered model lookups in tests with a context manager.Srinivas Reddy Thatiparthy (శ్రీనివాస్ రెడ్డి తాటిపర్తి)
2018-08-17Fixed #29024 -- Made TestContextDecorator call disable() if setUp() raises ↵Kamil
an exception.
2018-07-30Fixed #29467 -- Made override_settings handle errors in setting_changed ↵Sławek Ehlert
signal receivers.
2018-06-12Restored django.test.utils.patch_logger() for backwards compatibility.Jon Dufresne
Added back after 607970f31cc07c317f2ebb684c8f3ccc36a95b3e.
2018-05-07Replaced django.test.utils.patch_logger() with assertLogs().Claude Paroz
Thanks Tim Graham for the review.
2018-01-08Fixed #28869 -- Made tagged test classes and methods inherit tags from parents.Will Ayd
2018-01-03Fixed #28982 -- Simplified code with and/or.Дилян Палаузов
2017-12-26Fixed #28930 -- Simplified code with any() and all().Дилян Палаузов
2017-12-11Fixed #28909 -- Simplified code using tuple/list/set/dict unpacking.Nick Pope
2017-12-06Fixed #28893 -- Removed unnecessary dict.items() calls.Tim Graham
2017-09-11Fixed #28578 -- Renamed DatabaseCreation number arguments to suffix.Jon Dufresne
2017-08-24Used sets for CheckRegistry.registered_checks and deployment_checks.Sergey Fedoseev
2017-08-21Removed need for hasattr(check, 'tags') in CheckRegistry.Sergey Fedoseev
It was needed to pass tests because registered checks weren't properly mocked.
2017-05-18Fixed #28203 -- Ignored connection configuration queries in assertNumQueries().François Freitag
2017-04-27Removed obsolete django.test.utils.strip_quotes().Tim Graham
Django's test runners no longer discover doctests.
2017-04-27Replaced set |= operator with update() to avoid temporary set.Jon Dufresne
2017-03-04Refs #27656 -- Updated remaining docstring verbs according to PEP 257.Anton Samarchyan
2017-02-24Fixed #27873 -- Fixed crash in setup_test_environment() if ALLOWED_HOSTS is ↵Chris Lamb
a tuple. Regression in 17e661641ddaf8266e7430d83cfb2039abc55df7
2017-01-26Refs #23919, #27778 -- Removed obsolete mentions of unicode.Vytis Banaitis
2017-01-25Refs #23919 -- Replaced super(ClassName, self) with super().chillaranand
2017-01-21Refs #23919 -- Removed misc references to Python 2.Tim Graham
2017-01-21Refs #23919 -- Removed django.utils.decorators.available_attrs() usage.Tim Graham
It's only needed to workaround a bug on Python 2.
2017-01-20Refs #23919 -- Removed unneeded force_str callsClaude Paroz
2017-01-19Refs #23919 -- Removed reset_warning_registry() workaround for Python < 3.4.2.Tim Graham
2017-01-19Refs #23919 -- Stopped inheriting from object to define new style classes.Simon Charette
2017-01-18Refs #23919 -- Removed most of remaining six usageClaude Paroz
Thanks Tim Graham for the review.
2017-01-18Refs #23919 -- Removed six.<various>_types usageClaude Paroz
Thanks Tim Graham and Simon Charette for the reviews.
2017-01-18Refs #23919 -- Removed six.PY2/PY3 usageClaude Paroz
Thanks Tim Graham for the review.
2017-01-06Fixed #27698 -- Added django.test.utils.ContextList.get()Tim Graham
2016-08-17Fixed #26840 -- Added test.utils.setup/teardown_databases().Andreas Pelme
2016-08-15Fixed #27057 -- Made setup_test_environment() store saved settings in one place.Chris Jerdonek
2016-08-10Fixed #27019 -- Made teardown_test_environment() restore the old DEBUG.Chris Jerdonek
2016-08-08Fixed #27032 -- Prevented setup_test_environment() from being called twice.Chris Jerdonek
2016-08-05Edited docs of test.utils.setup/teardown_test_environment().Chris Jerdonek