summaryrefslogtreecommitdiff
path: root/tests/delete/tests.py
AgeCommit message (Collapse)Author
2020-10-19Fixed #32107 -- Fixed ProtectedError.protected_objects and ↵Hasan Ramezani
RestrictedError.restricted_objects. Regression in 4ca5c565f4dc9e97845036e86416abc5cfde766c and ab3cbd8b9a315911248227208630a020cedca08f. Thanks Vitaliy Yelnik for the report.
2020-08-31Fixed #31965 -- Adjusted multi-table fast-deletion on MySQL/MariaDB.Simon Charette
The optimization introduced in 7acef095d73 did not properly handle deletion involving filters against aggregate annotations. It initially was surfaced by a MariaDB test failure but misattributed to an undocumented change in behavior that resulted in the systemic generation of poorly performing database queries in 5b83bae031. Thanks Anton Plotkin for the report. Refs #23576.
2020-05-25Fixed #31624 -- Avoided subquery usage on QuerySet.all().delete().Simon Charette
Thanks Adam Johnson for the report. Regression in 7acef095d73322f45dcceb99afa1a4e50b520479.
2020-04-20Fixed #31474 -- Made QuerySet.delete() not return the number of deleted ↵Hasan Ramezani
objects if it's zero.
2020-02-04Simplified imports from django.db and django.contrib.gis.db.Nick Pope
2020-01-31Fixed #31219 -- Fixed object deletion crash for nested protected related ↵Matthias Kestenholz
objects.
2020-01-29Refs #27852 -- Fixed object deletion to show all restricted related objects ↵Hasan Ramezani
rather than just the first one.
2020-01-27Made OnDeleteTests.test_protect() assert more specific ProtectedError.Mariusz Felisiak
2020-01-27Refs #27852 -- Fixed object deletion to show all protected related objects ↵Hasan Ramezani
rather than just the first one. Thanks Anton Samarchyan for the initial patch.
2019-11-19Fixed #27272 -- Added an on_delete RESTRICT handler to allow cascading ↵Daniel Izquierdo
deletions while protecting direct ones.
2019-10-24Fixed #23576 -- Implemented multi-alias fast-path deletion in MySQL backend.Simon Charette
This required moving the entirety of DELETE SQL generation to the compiler where it should have been in the first place and implementing a specialized compiler on MySQL/MariaDB. The MySQL compiler relies on the "DELETE table FROM table JOIN" syntax for queries spanning over multiple tables.
2019-10-09Fixed #30856 -- Combined fast-delete queries by model during cascade deletion.Simon Charette
Reduced the number of queries required when performing cascade deletion for a model referenced multiple time by another one by performing an union of reference lookups.
2019-05-13Fixed #30436 -- Added check that on_delete is callable in ForeignKey and ↵Rob
OneToOneField.
2019-05-06Fixed #30339 -- Made Model.delete(keep_parents=True) preserves nested parent ↵Stephen Brown
reverse relationships. Thanks Simon Charette for the review.
2019-04-17Fixed #30191 -- Selected only referenced fields during cascade deletion.Simon Charette
The non-referenced fields can only be deferred if no deletion signals receivers are connected for their respective model as connected as these receivers might expect all fields of the deleted model to be present. Thanks Ed Morley for the report.
2019-04-08Fixed #30330 -- Fixed setting of primary key to None during fast-delete.Florian Apolloner
Regression in bc7dd8490b882b2cefdc7faf431dc64c532b79c9.
2017-10-02Fixed incorrect integer division in DeletionTests.test_large_delete_related.Mariusz Felisiak
2017-10-02Refs #23919 -- Removed unneeded float()/int() calls.Mariusz Felisiak
2017-07-29Used assertRaisesMessage() to test Django's error messages.Mads Jensen
2017-06-01Refs #23968 -- Removed unnecessary lists, generators, and tuple calls.Jon Dufresne
2017-01-18Refs #23919 -- Removed most of remaining six usageClaude Paroz
Thanks Tim Graham for the review.
2017-01-18Refs #23919 -- Removed encoding preambles and future importsClaude Paroz
2016-11-15Fixed #27407 -- Made Model.delete(keep_parents=True) preserve parent reverse ↵Simon Charette
relationships. Thanks Tim for the review.
2016-11-10Refs #27392 -- Removed "Tests that", "Ensures that", etc. from test docstrings.za
2016-09-08Refs #15250 -- Removed an obsolete comment regarding MTI cascade deletion.Simon Charette
2016-03-28Sorted single letter imports per the latest version of isort.Tim Graham
2016-01-29Refs #26022 -- Used context manager version of assertRaises in tests.Hasan
2015-12-14Fixed #25882 -- Prevented fast deletes matching no rows from crashing on MySQL.Simon Charette
Thanks to Trac aliases gerricom for the report, raphaelmerx for the attempts to reproduce and Sergey Fedoseev and Tim for the review. Refs #16891
2015-11-22Fixed #25685 -- Fixed a duplicate query regression on deletion of proxied ↵Simon Charette
models. Thanks to Trac alias ppetrid for the report and Tim for the review. Conflicts: django/db/models/deletion.py tests/delete/tests.py Forward port of 7c3ef19978b36b61db88a519f799f1ce8d019679 from stable/1.8.x
2015-11-09Fixed #24576 -- Made deletion of related objects deterministic.Laura Feier
2015-07-21Fixed #25129 -- Made model instance defaults work with migrations (refs #24919).Tim Graham
2015-05-22Fixed #16891 -- Made Model/QuerySet.delete() return the number of deleted ↵Alexander Sosnovskiy
objects.
2015-04-28Fixed #24714 -- Used more specific assertions than assertEqual in tests.Alasdair Nicol
2015-03-25Renamed Field.rel attribute to remote_fieldAnssi Kääriäinen
Field.rel is now deprecated. Rel objects have now also remote_field attribute. This means that self == self.remote_field.remote_field. In addition, made the Rel objects a bit more like Field objects. Still, marked ManyToManyFields as null=True.
2015-03-17Fixed #15579 -- Added ability to delete only child models in multi-table ↵Andriy Sokolovskiy
inheritance.
2015-02-06Sorted imports with isort; refs #23860.Tim Graham
2015-01-20Fixed typos in code comments.Adam Taylor
2014-12-13Fixed #23812 -- Changed django.utils.six.moves.xrange imports to rangeMichael Hall
2014-08-11Fixed #16426 -- deletion of 1000+ objects with relations on SQLiteAnssi Kääriäinen
SQLite doesn't work with more than 1000 parameters in a single query. The deletion code could generate queries that try to get related objects for more than 1000 objects thus breaking the limit. Django now splits the related object fetching into batches with at most 1000 parameters. The tests and patch include some work done by Trac alias NiGhTTraX in ticket #21205.
2013-11-02PEP8 cleanupJason Myers
Signed-off-by: Jason Myers <jason@jasonamyers.com>
2013-11-02Fixed #21302 -- Fixed unused imports and import *.Tim Graham
2013-10-23Fixed #21298 -- Fixed E301 pep8 warningsAlasdair Nicol
2013-09-08Removed some more unused local varsAlex Gaynor
2013-07-29Removed most of absolute_import importsClaude Paroz
Should be unneeded with Python 2.7 and up. Added some unicode_literals along the way.
2013-02-26Merged regressiontests and modeltests into the test root.Florian Apolloner