summaryrefslogtreecommitdiff
path: root/django/test/utils.py
Commit message (Collapse)AuthorAgeFilesLines
* Refs #32446 -- Removed SERIALIZE test database setting per deprecation timeline.Mariusz Felisiak2023-01-171-21/+3
|
* Refs #34118 -- Adopted asgiref coroutine detection shims.Carlton Gibson2022-12-201-2/+3
| | | Thanks to Mariusz Felisiak for review.
* Used more augmented assignment statements.Nick Pope2022-10-311-1/+1
| | | | | | Identified using the following command: $ git grep -I '\(\<[_a-zA-Z0-9]\+\>\) *= *\1 *[-+/*^%&|<>@]'
* Refs #33476 -- Refactored code to strictly match 88 characters line length.Mariusz Felisiak2022-02-071-1/+4
|
* Refs #33476 -- Reformatted code with Black.django-bot2022-02-071-88/+133
|
* Refs #20349 -- Avoided loading testing libraries when not needed.Collin Anderson2022-01-251-2/+2
|
* Refs #32655 -- Improved error if iter_test_cases() is passed a string.Chris Jerdonek2021-06-291-0/+7
|
* Refs #32489 -- Doc'd and tested iter_test_cases() support for an iterable of ↵Chris Jerdonek2021-03-111-3/+7
| | | | tests.
* Fixed #32516 -- Fixed reorder_suite() with duplicates and reverse=True.Chris Jerdonek2021-03-091-4/+2
|
* Fixed #32489 -- Added iter_test_cases() to iterate over a TestSuite.Chris Jerdonek2021-03-051-0/+12
| | | | | | This also makes partition_suite_by_type(), partition_suite_by_case(), filter_tests_by_tags(), and DiscoverRunner._get_databases() to use iter_test_cases().
* Fixed #32446 -- Deprecated SERIALIZE test database setting.Simon Charette2021-02-241-3/+32
| | | | | | | | | | | 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.
* Refs #31811 -- Restored **kwargs to django.test.utils.setup_databases().Mariusz Felisiak2021-02-241-1/+1
| | | Accidentally removed in 61a0ba43cfd4ff66f51a9d73dcd8ed6f6a6d9915.
* Fixed #29052 -- Made test database creation preserve alias order and prefer ↵Harm Geerts2021-02-161-2/+7
| | | | | | | | | | | | | | 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.
* Fixed #31944 -- Used addCleanup() to register TestContextDecorator cleanups.François Freitag2020-09-071-11/+2
| | | | | | 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.
* Fixed #31979 -- Made django.test.utils.setup_databases()'s time_keeper ↵Jon Dufresne2020-09-031-1/+4
| | | | argument optional.
* Added missing items to django.test.client.__all__ and django.test.utils.__all__.Mads Jensen2020-08-141-2/+4
|
* Refs #31811 -- Added optional timing outputs to the test runner.Ahmad A. Hussein2020-08-131-12/+47
|
* Fixed #31224 -- Added support for asynchronous views and middleware.Andrew Godwin2020-03-181-6/+17
| | | | | This implements support for asynchronous views, asynchronous tests, asynchronous middleware, and an asynchronous test client.
* Fixed #31250 -- Ignored processing instructions in ↵yura2020-02-131-3/+7
| | | | assertXMLEqual()/assertXMLNotEqual().
* Removed unnecessary dict.get() call in favor of direct indexing.Jon Dufresne2019-12-041-1/+1
| | | The 'TEST' key is always set to a dictionary in ConnectionHandler.
* Fixed #30497 -- Ignored document type in assertXMLEqual()/assertXMLNotEqual().Caio Ariede2019-05-241-2/+3
|
* Removed unnecessary assignments in various code.Jon Dufresne2019-04-241-4/+2
|
* Fixed #30159 -- Removed unneeded use of OrderedDict.Nick Pope2019-02-061-3/+1
| | | | Dicts preserve order since Python 3.6.
* Refs #27753 -- Removed django.test.utils.patch_logger() and str_prefix().Tim Graham2019-02-051-27/+0
|
* Fixed #28478 -- Make DiscoverRunner skip creating unused test databases.Simon Charette2019-01-101-4/+6
| | | | | SimpleTestCase.databases makes it possible to determine the set of databases required to run the discovered tests.
* Fixed typo in patch_logger() docstring.takaaki shimbo2018-11-251-1/+1
|
* Refs #28909 -- Simplifed code using unpacking generalizations.Sergey Fedoseev2018-09-281-1/+1
|
* Fixed #29658 -- Registered model lookups in tests with a context manager.Srinivas Reddy Thatiparthy (శ్రీనివాస్ రెడ్డి తాటిపర్తి)2018-08-211-0/+15
|
* Fixed #29024 -- Made TestContextDecorator call disable() if setUp() raises ↵Kamil2018-08-171-1/+5
| | | | an exception.
* Fixed #29467 -- Made override_settings handle errors in setting_changed ↵Sławek Ehlert2018-07-301-4/+23
| | | | signal receivers.
* Restored django.test.utils.patch_logger() for backwards compatibility.Jon Dufresne2018-06-121-0/+23
| | | | Added back after 607970f31cc07c317f2ebb684c8f3ccc36a95b3e.
* Replaced django.test.utils.patch_logger() with assertLogs().Claude Paroz2018-05-071-20/+0
| | | | Thanks Tim Graham for the review.
* Fixed #28869 -- Made tagged test classes and methods inherit tags from parents.Will Ayd2018-01-081-1/+4
|
* Fixed #28982 -- Simplified code with and/or.Дилян Палаузов2018-01-031-6/+2
|
* Fixed #28930 -- Simplified code with any() and all().Дилян Палаузов2017-12-261-4/+1
|
* Fixed #28909 -- Simplified code using tuple/list/set/dict unpacking.Nick Pope2017-12-111-2/+4
|
* Fixed #28893 -- Removed unnecessary dict.items() calls.Tim Graham2017-12-061-1/+1
|
* Fixed #28578 -- Renamed DatabaseCreation number arguments to suffix.Jon Dufresne2017-09-111-2/+2
|
* Used sets for CheckRegistry.registered_checks and deployment_checks.Sergey Fedoseev2017-08-241-2/+2
|
* Removed need for hasattr(check, 'tags') in CheckRegistry.Sergey Fedoseev2017-08-211-2/+6
| | | It was needed to pass tests because registered checks weren't properly mocked.
* Fixed #28203 -- Ignored connection configuration queries in assertNumQueries().François Freitag2017-05-181-0/+3
|
* Removed obsolete django.test.utils.strip_quotes().Tim Graham2017-04-271-20/+0
| | | Django's test runners no longer discover doctests.
* Replaced set |= operator with update() to avoid temporary set.Jon Dufresne2017-04-271-5/+2
|
* Refs #27656 -- Updated remaining docstring verbs according to PEP 257.Anton Samarchyan2017-03-041-26/+18
|
* Fixed #27873 -- Fixed crash in setup_test_environment() if ALLOWED_HOSTS is ↵Chris Lamb2017-02-241-1/+1
| | | | | a tuple. Regression in 17e661641ddaf8266e7430d83cfb2039abc55df7
* Refs #23919, #27778 -- Removed obsolete mentions of unicode.Vytis Banaitis2017-01-261-7/+0
|
* Refs #23919 -- Replaced super(ClassName, self) with super().chillaranand2017-01-251-7/+7
|
* Refs #23919 -- Removed misc references to Python 2.Tim Graham2017-01-211-1/+1
|
* Refs #23919 -- Removed django.utils.decorators.available_attrs() usage.Tim Graham2017-01-211-2/+1
| | | It's only needed to workaround a bug on Python 2.
* Refs #23919 -- Removed unneeded force_str callsClaude Paroz2017-01-201-2/+1
|