summaryrefslogtreecommitdiff
path: root/tests/delete
AgeCommit message (Collapse)Author
2022-12-30Fixed random delete.tests.DeletionTests.test_deletion_order failures.Mariusz Felisiak
2022-11-07Refs #33374 -- Added tests for multi-table fast-deletion with filters that ↵Simon Charette
match everything.
2022-09-16Fixed test_relational_post_delete_signals_happen_before_parent_object when ↵Mariusz Felisiak
run in isolation.
2022-02-07Refs #33476 -- Refactored code to strictly match 88 characters line length.Mariusz Felisiak
2022-02-07Refs #33476 -- Reformatted code with Black.django-bot
2021-11-24Fixed typo in delete test docstring.Tim Graham
2021-07-15Refs #32508 -- Raised Type/ValueError instead of using "assert" in ↵Daniyal
django.db.models. Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2021-03-10Refs #32508 -- Raised TypeError instead of using "assert" on unsupported ↵Mariusz Felisiak
operations for sliced querysets.
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-30Removed unused __str__() methods in tests models.Mariusz Felisiak
Follow up to 6461583b6cc257d25880ef9a9fd7e2125ac53ce1.
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 python_2_unicode_compatible decorator usageClaude Paroz
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-04-08Fixed E128 flake8 warnings in tests/.Tim Graham
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-27Fixed #21127 -- Started deprecation toward requiring on_delete for ↵Flavio Curella
ForeignKey/OneToOneField
2015-07-21Fixed #25129 -- Made model instance defaults work with migrations (refs #24919).Tim Graham
2015-07-21Refs #24919 -- Made test models serializable for migrations.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