summaryrefslogtreecommitdiff
path: root/django/test/testcases.py
AgeCommit message (Collapse)Author
2020-11-27Fixed #32220 -- Added durable argument to transaction.atomic().Ian Foote
2020-11-06Fixed #31235 -- Made assertQuerysetEqual() compare querysets directly.Hasan Ramezani
This also replaces assertQuerysetEqual() to assertSequenceEqual()/assertCountEqual() where appropriate. Co-authored-by: Peter Inglesby <peter.inglesby@gmail.com> Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2020-08-14Removed unnecessary urlsplit() call from SimpleTestCase.assertRedirects().Mads Jensen
2020-07-13Fixed #30457 -- Added TestCase.captureOnCommitCallbacks().Adam Johnson
2020-05-15Fixed #31395 -- Made setUpTestData enforce in-memory data isolation.Simon Charette
Since it's introduction in Django 1.8 setUpTestData has been suffering from a documented but confusing caveat due to its sharing of attributes assigned during its execution with all test instances. By keeping track of class attributes assigned during the setUpTestData phase its possible to ensure only deep copies are provided to test instances on attribute retreival and prevent manual setUp gymnastic to work around the previous lack of in-memory data isolation. Thanks Adam Johnson for the extensive review.
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-03-05Refs #31224 -- Added autoconversion of test async methods.Andrew Godwin
2019-10-21Fixed #30876 -- Moved classproperty() decorator to the django.utils.functional.André Ericson
2019-10-18Fixed #27391 -- Implemented SimpleTestCase.debug().Pavel Savchenko
debug() should bubbled up exceptions if occurring in test, but behave the same as run() when no exceptions occurred.
2019-10-18Fixed #28337 -- Preserved extra headers of requests made with ↵Patrick Jenkins
django.test.Client in assertRedirects(). Co-Authored-By: Hasan Ramezani <hasan.r67@gmail.com>
2019-09-10Refs #28478 -- Removed support for TestCase's allow_database_queries and ↵Mariusz Felisiak
multi_db per deprecation timeline.
2019-02-14Fixed #30171 -- Fixed DatabaseError in servers tests.Jon Dufresne
Made DatabaseWrapper thread sharing logic reentrant. Used a reference counting like scheme to allow nested uses. The error appeared after 8c775391b78b2a4a2b57c5e89ed4888f36aada4b.
2019-01-21Fixed #30121 -- Fixed assertURLEqual() crash with reverse_lazy() URLs.Jon Dufresne
Regression in 24959e48d949a20be969f649ece3576dbc7ce422.
2019-01-14Refs #28478 -- Prevented database feature based skipping on tests ↵Simon Charette
disallowing queries. Database features may require a connection to be established to determine whether or not they are enabled.
2019-01-14Refs #28478 -- Prevented connection attempts against disallowed databases in ↵Simon Charette
tests. Mocking connect as well as cursor methods makes sure an appropriate error message is surfaced when running a subset of test attempting to access a a disallowed database.
2019-01-10Refs #28478 -- Deprecated TestCase's allow_database_queries and multi_db in ↵Simon Charette
favor of databases.
2018-12-05Reverted "Fixed #25251 -- Made data migrations available in ↵Tim Graham
TransactionTestCase when using --keepdb." This reverts commits b3b1d3d45fc066367f4fcacf0b06f72fcd00a9c6 and 9fa0d3786febf36c87ef059a39115aa1ce3326e8 due to reverse build failures for which a solution isn't forthcoming.
2018-11-06Fixed #25251 -- Made data migrations available in TransactionTestCase when ↵romgar
using --keepdb. Data loaded in migrations were restored at the beginning of each TransactionTestCase and all the tables are truncated at the end of these test cases. If there was a TransactionTestCase at the end of the test suite, the migrated data weren't restored in the database (especially unexpected when using --keepdb). Now data is restored at the end of each TransactionTestCase.
2018-11-03Fixed #29883 -- Added selenium hub support to runtests.py.Tom Forbes
2018-09-28Refs #28909 -- Simplifed code using unpacking generalizations.Sergey Fedoseev
2018-07-18Removed duplicate words in various comments.Mariusz Felisiak
2018-06-20Fixed #27398 -- Added an assertion to compare URLs, ignoring the order of ↵Jan Pieter Waagmeester
their query strings.
2018-05-09Fixed #29363 -- Added SimpleTestCase.assertWarnsMessage().Morgan Aubert
2018-03-31Fixed #29275 -- Made assertFormError() output "(actual errors: none)" ↵Chris Lamb
instead of "(actual errors: )".
2018-02-10Refs #27795 -- Removed force_text() usage in django/test/testcases.py.Jon Dufresne
2017-12-21Refs #28909 -- Simplifed code using unpacking generalizations.Nick Pope
2017-12-11Fixed #28909 -- Simplified code using tuple/list/set/dict unpacking.Nick Pope
2017-12-04Fixed #28860 -- Removed unnecessary len() calls.Дилян Палаузов
2017-11-28Fixed #28853 -- Updated connection.cursor() uses to use a context manager.Jon Dufresne
2017-09-25Refs #27857 -- Replaced json.loads() ValueError exception catching with ↵Tim Graham
JSONDecodeError.
2017-09-09Fixed some comments referring to a nonexistent TestClient class.Luoxzhg
2017-06-18Refs #27539 -- Fixed typo in TransactionTestCase._pre_setup() comment.François Freitag
2017-06-16Fixed #27539 -- Made TransactionTestCase._pre_setup() clear the queries_log ↵reficul31
so it's less likely to overflow. TransactionTestCase.assertNumQueries() fails in an overflow situation.
2017-06-16Refs #27787 -- Corrected or removed invalid call_command() options.Chandrakant Kumar
2017-05-30Fixed #28212 -- Allowed customizing the port that LiveServerTestCase uses.Robert Rollins
Forwardport of 877d7b71ae952b3bc946e5187d6c23039a71614d from stable/1.11.x
2017-05-20Fixed #28180 -- Numbered queries in assertNumQueries failure outputClaude Paroz
Thanks Tim Graham for the test part.
2017-03-04Refs #27656 -- Updated remaining docstring verbs according to PEP 257.Anton Samarchyan
2017-02-13Added TransactionTestCase.multi_db instead of using getattr().Tim Graham
2017-02-09Fixed #20238 -- Added threading support to LiveServerTestCase.Nadège Michel
2017-02-01Refs #23919 -- Replaced kwargs.pop() with keyword-only arguments.Vytis Banaitis
2017-01-25Refs #23919 -- Replaced super(ClassName, self) with super().chillaranand
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-18Refs #23919 -- Removed encoding preambles and future importsClaude Paroz
2017-01-17Refs #25190 -- Removed callable_obj parameter to assertRaisesMessages().Tim Graham
Per deprecation timeline.
2017-01-17Refs #23960 -- Removed the host parameter for SimpleTestCase.assertRedirects().Tim Graham
Per deprecation timeline.
2017-01-11Refs #16614 -- Made QuerySet.iterator() use server-side cursors on PostgreSQL.François Freitag
Thanks to Josh Smeaton for the idea of implementing server-side cursors in PostgreSQL from the iterator method, and Anssi Kääriäinen and Kevin Turner for their previous work. Also Simon Charette and Tim Graham for review.
2016-12-07Fixed #27579 -- Added aliases for Python 3's assertion names in SimpleTestCase.Tim Graham