summaryrefslogtreecommitdiff
path: root/tests/delete_regress
Commit message (Collapse)AuthorAgeFilesLines
* Fixed #33759 -- Avoided unnecessary subquery in QuerySet.delete() with ↵4the4ryushin2023-05-011-8/+13
| | | | self-referential subqueries if supported.
* Refs #33476 -- Applied Black's 2023 stable style.David Smith2023-02-011-2/+0
| | | | | | | | 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
* Fixed #33928 -- Avoided unnecessary queries when cascade updating.Simon Charette2022-08-272-0/+22
| | | | | | | | | | | | | | | | | | | | | | | Models that use SET, SET_NULL, and SET_DEFAULT as on_delete handler don't have to fetch objects for the sole purpose of passing them back to a follow up UPDATE query filtered by the retrieved objects primary key. This was achieved by flagging SET handlers as _lazy_ and having the collector logic defer object collections until the last minute. This should ensure that the rare cases where custom on_delete handlers are defined remain uncalled when when dealing with an empty collection of instances. This reduces the number queries required to apply SET handlers from 2 to 1 where the remaining UPDATE use the same predicate as the non removed SELECT query. In a lot of ways this is similar to the fast-delete optimization that was added in #18676 but for updates this time. The conditions only happen to be simpler in this case because SET handlers are always terminal. They never cascade to more deletes that can be combined. Thanks Renan GEHAN for the report.
* Refs #33476 -- Refactored code to strictly match 88 characters line length.Mariusz Felisiak2022-02-071-1/+3
|
* Refs #33476 -- Reformatted code with Black.django-bot2022-02-072-67/+90
|
* Refs #32682 -- Fixed QuerySet.delete() crash on querysets with ↵Mariusz Felisiak2021-04-272-0/+15
| | | | self-referential subqueries on MySQL.
* Fixed #32433 -- Added error message on QuerySet.delete() following distinct().Egidijus Macijauskas2021-02-111-1/+12
|
* Refs #19102 -- Removed flaky test ↵Egidijus Macijauskas2021-02-111-14/+0
| | | | | | | | | | | Ticket19102Tests.test_ticket_19102_distinct_on. The subquery pushdown only happens because another table is involved in filter. It's not the distinct usage that causes the pushdown. The distinct('description').order_by('pk') expression is not valid because SELECT DISTINCT ON must match initial ORDER BY expressions which is not the case here.
* Switched setUp() to setUpTestData() where possible in Django's tests.Simon Charette2018-11-271-5/+6
|
* Fixed hanging indentation in various code.Mariusz Felisiak2018-03-161-6/+3
|
* Fixed #29016 -- Fixed incorrect foreign key nullification on related ↵Étienne Loks2018-01-132-2/+28
| | | | instance deletion.
* Used assertRaisesMessage() to test Django's error messages.Mads Jensen2017-07-291-2/+3
|
* Refs #23919 -- Removed encoding preambles and future importsClaude Paroz2017-01-181-2/+0
|
* Changed database connection duplication technique.Aymeric Augustin2015-09-091-5/+2
| | | | | | This new technique is more straightforward and compatible with test parallelization, where the effective database connection settings no longer match settings.DATABASES.
* Fixed #25331 -- Removed trailing blank lines in docstrings.Maxime Lorant2015-08-311-8/+0
|
* Fixed #21127 -- Started deprecation toward requiring on_delete for ↵Flavio Curella2015-07-271-15/+15
| | | | ForeignKey/OneToOneField
* Sorted imports with isort; refs #23860.Tim Graham2015-02-062-6/+8
|
* Fixed #22308 -- Regression from 0f956085.Aymeric Augustin2014-03-221-17/+15
| | | | Rewrote the test for #9479 according to the original ticket.
* Removed legacy transaction management per the deprecation timeline.Aymeric Augustin2014-03-211-17/+11
|
* Fixed #19774 -- Deprecated the contenttypes.generic module.Simon Charette2014-01-261-3/+5
| | | | | | | It contained models, forms and admin objects causing undesirable import side effects. Refs #16368. Thanks to Ramiro, Carl and Loïc for the review.
* PEP8 cleanupJason Myers2013-11-022-1/+30
| | | | Signed-off-by: Jason Myers <jason@jasonamyers.com>
* Fix all violators of E231Alex Gaynor2013-10-261-1/+1
|
* Fixed #21298 -- Fixed E301 pep8 warningsAlasdair Nicol2013-10-231-0/+1
|
* Fixed #21268 -- Fixed E303 pep8 warningsAlasdair Nicol2013-10-181-4/+0
|
* Removed unneeded imports in tests's __init__.py and unified them.Florian Apolloner2013-09-091-1/+0
|
* Removed some more unused local varsAlex Gaynor2013-09-081-7/+7
|
* Removed most of absolute_import importsClaude Paroz2013-07-291-1/+1
| | | | | Should be unneeded with Python 2.7 and up. Added some unicode_literals along the way.
* Defined available_apps in relevant tests.Aymeric Augustin2013-06-101-0/+6
| | | | Fixed #20483.
* Made transaction.managed a no-op and deprecated it.Aymeric Augustin2013-03-111-3/+1
| | | | | | | | | | | | | | enter_transaction_management() was nearly always followed by managed(). In three places it wasn't, but they will all be refactored eventually. The "forced" keyword argument avoids introducing behavior changes until then. This is mostly backwards-compatible, except, of course, for managed itself. There's a minor difference in _enter_transaction_management: the top self.transaction_state now contains the new 'managed' state rather than the previous one. Django doesn't access self.transaction_state in _enter_transaction_management.
* Fixed #19861 -- Transaction ._dirty flag improvementAnssi Kääriäinen2013-02-271-1/+3
| | | | | | | | | | | | | | | | | | There were a couple of errors in ._dirty flag handling: * It started as None, but was never reset to None. * The _dirty flag was sometimes used to indicate if the connection was inside transaction management, but this was not done consistently. This also meant the flag had three separate values. * The None value had a special meaning, causing for example inability to commit() on new connection unless enter/leave tx management was done. * The _dirty was tracking "connection in transaction" state, but only in managed transactions. * Some tests never reset the transaction state of the used connection. * And some additional less important changes. This commit has some potential for regressions, but as the above list shows, the current situation isn't perfect either.
* Merged regressiontests and modeltests into the test root.Florian Apolloner2013-02-263-0/+472