summaryrefslogtreecommitdiff
path: root/tests/prefetch_related
Commit message (Collapse)AuthorAgeFilesLines
* Refs #29984 -- Made QuerySet.iterator() without chunk_size raise ValueError ↵Mariusz Felisiak2023-01-171-19/+5
| | | | | | after prefetch_related(). Per deprecation timeline.
* Removed unnecessary commas in tests.Mariusz Felisiak2022-12-211-2/+2
|
* Fixed #33984 -- Reverted "Fixed #32980 -- Made models cache related managers."Mariusz Felisiak2022-09-301-8/+0
| | | | | | | | This reverts 4f8c7fd9d91b35e2c2922de4bb50c8c8066cbbc6 and adds two regression tests: - test_related_manager_refresh(), and - test_create_copy_with_m2m(). Thanks joeli for the report.
* Refs #26780 -- Made prefetch_related() don't use window expressions fo ↵Mariusz Felisiak2022-09-061-2/+21
| | | | sliced queries if not supported.
* Fixed #26780 -- Added prefetch_related() support for sliced queries.Simon Charette2022-08-151-0/+64
| | | | | This was made possible by window function filtering support added in f387d024fc75569d2a4a338bfda76cc2f328f627.
* Relaxed some query ordering assertions in various tests.Mariusz Felisiak2022-04-141-1/+1
| | | It accounts for differences seen on MySQL with MyISAM storage engine.
* Removed redundant QuerySet.all() calls in docs and tests.Nick Pope2022-02-221-31/+21
| | | | Most QuerySet methods are mapped onto the Manager and, in general, it isn't necessary to call .all() on the manager.
* Refs #33476 -- Refactored code to strictly match 88 characters line length.Mariusz Felisiak2022-02-072-4/+8
|
* Refs #33476 -- Reformatted code with Black.django-bot2022-02-074-649/+947
|
* Refs #33476 -- Refactored problematic code before reformatting by Black.Mariusz Felisiak2022-02-031-10/+12
| | | | | | | | | | | | | | | | | In these cases Black produces unexpected results, e.g. def make_random_password( self, length=10, allowed_chars='abcdefghjkmnpqrstuvwxyz' 'ABCDEFGHJKLMNPQRSTUVWXYZ' '23456789', ): or cursor.execute(""" SELECT ... """, [table name], )
* Fixed #29984 -- Added QuerySet.iterator() support for prefetching related ↵Jacob Walls2022-01-251-1/+34
| | | | | | | objects. Co-authored-by: Raphael Kimmig <raphael.kimmig@ampad.de> Co-authored-by: Simon Charette <charette.s@gmail.com>
* Fixed #32511 -- Corrected handling prefetched nested reverse relationships.Jamie Matthews2022-01-051-0/+26
| | | | | | | | | | When prefetching a set of child objects related to a set of parent objects, we usually want to populate the relationship back from the child to the parent to avoid a query when accessing that relationship attribute. However, there's an edge case where the child queryset itself specifies a prefetch back to the parent. In that case, we want to use the prefetched relationship rather than populating the reverse relationship from the parent.
* Fixed #32980 -- Made models cache related managers.Keryn Knight2021-11-081-0/+8
|
* Fixed #33008 -- Fixed prefetch_related() for deleted GenericForeignKeys.Martin Svoboda2021-10-141-0/+18
| | | | Thanks Simon Charette for the implementation idea.
* Fixed #32812 -- Restored immutability of named values from ↵Takayuki Hirayama2021-06-041-0/+7
| | | | | | | | QuerySet.values_list(). Regression in 981a072dd4dec586f8fc606712ed9a2ef116eeee. Thanks pirelle for the report.
* Fixed #32089 -- Fixed prefetch_related_objects() when some objects are ↵Alexey Nigin2020-12-161-0/+26
| | | | | | | | | already fetched. Thanks Dennis Kliban for the report and Adam Johnson for the initial patch. Co-authored-by: Adam Johnson <me@adamj.eu>
* Fixed #31235 -- Made assertQuerysetEqual() compare querysets directly.Hasan Ramezani2020-11-061-2/+2
| | | | | | | | 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>
* Refs #20577 -- Deferred filtering of prefetched related querysets by reverse ↵Bob Renwick2020-10-061-9/+12
| | | | m2o relation.
* Refs #31395 -- Relied on setUpTestData() test data isolation in various tests.Simon Charette2020-05-151-86/+88
|
* Removed unused __str__() methods in tests models.Mariusz Felisiak2020-04-301-21/+0
| | | Follow up to 6461583b6cc257d25880ef9a9fd7e2125ac53ce1.
* Simplified imports from django.db and django.contrib.gis.db.Nick Pope2020-02-042-4/+4
|
* Refs #31044 -- Fixed error message when using Prefetch with a values_list() ↵Mariusz Felisiak2019-12-091-2/+4
| | | | queryset.
* Fixed #31044 -- Errored nicely when using Prefetch with a raw() queryset.Hasan Ramezani2019-12-091-1/+7
|
* Fixed #20577 -- Deferred filtering of prefetched related querysets.Alex Aktsipetrov2019-10-211-0/+31
| | | | | | | Added internal interface to QuerySet that allows to defer next filter call till .query is accessed. Used it to optimize prefetch_related(). Thanks Simon Charette for the review.
* Fixed #30651 -- Made __eq__() methods return NotImplemented for not ↵ElizabethU2019-10-011-0/+3
| | | | | | | | | implemented comparisons. Changed __eq__ to return NotImplemented instead of False if compared to an object of the same type, as is recommended by the Python data model reference. Now these models can be compared to ANY (or other objects with __eq__ overwritten) without returning False automatically.
* Refs #30651 -- Added tests for Prefetch.__eq__().Mariusz Felisiak2019-10-011-0/+6
|
* Fixed typo in tests/prefetch_related/tests.py comment.Tim Gates2019-08-261-1/+1
|
* Fixed typos in test names and a comment.Min ho Kim2019-08-231-1/+1
|
* Fixed #30482 -- Prevented unnecessary evaluation of lookup.queryset in ↵Iain Watts2019-05-161-5/+10
| | | | prefetch_related_objects().
* Fixed #30368 -- Fixed prefetch_related() for GenericForeignKey when PK is ↵Vinny Do2019-04-161-0/+7
| | | | also a FK.
* Fixed #30343 -- Fixed prefetch_related() for GenericForeignKey when PK of ↵Mariusz Felisiak2019-04-142-5/+19
| | | | related field is UUIDField.
* Refs #28478 -- Deprecated TestCase's allow_database_queries and multi_db in ↵Simon Charette2019-01-101-1/+1
| | | | favor of databases.
* Followed style guide for model attribute ordering.Matt Wiens2018-12-271-21/+21
|
* Fixed #29230 -- Fixed nested prefetches that clash with descriptors.Paulo2018-05-271-0/+13
|
* Fixed #28600 -- Added prefetch_related() support to RawQuerySet.Adnan Umer2018-04-191-1/+35
|
* Refs #28723 -- Fixed stale prefetch_related cache after add/remove.Jon Dufresne2018-02-052-1/+17
| | | Regression in 514b2c989a948e3c59bda0da0c9427acf643cf5b.
* Made prefetch_related tests use assertCountEqual() for unordered sequences.Jon Dufresne2018-02-051-5/+5
|
* Fixed #28723 -- Fixed RelatedManager's prefetch_related() cache name.Mike Hansen2017-11-021-1/+11
|
* Fixed #28375 -- Fixed KeyError crash on reverse prefetch of a model with ↵Paulo2017-08-212-1/+23
| | | | OneToOneField primary key to a non-pk field.
* Used assertRaisesMessage() to test Django's error messages.Mads Jensen2017-07-291-4/+20
|
* Refs #23968 -- Removed unnecessary lists, generators, and tuple calls.Jon Dufresne2017-06-011-1/+1
|
* Sorted imports per isort 4.2.9.Tim Graham2017-06-011-2/+0
|
* Refs #25546 -- Added detailed comments for prefetch_related test.François Freitag2017-05-041-7/+17
|
* Fixed #27554 -- Fixed prefetch_related() crash when fetching relations in ↵François Freitag2017-05-041-0/+34
| | | | nested Prefetches.
* Fixed #28096 -- Allowed prefetch calls with ModelIterable subclassesClaude Paroz2017-04-192-2/+17
| | | | | Regression in 7ec330eeb96d0874949eacb8ed1bbb97e11807e1. Thanks Tim Graham for the review.
* Replaced type-specific assertions with assertEqual().Tim Graham2017-03-171-10/+10
| | | Python docs say, "it's usually not necessary to invoke these methods directly."
* Refs #23919 -- Replaced super(ClassName, self) with super().chillaranand2017-01-251-1/+1
|
* Removed unneeded force_text calls in the test suiteClaude Paroz2017-01-241-2/+1
|
* Refs #23919 -- Removed six.<various>_types usageClaude Paroz2017-01-181-20/+19
| | | | Thanks Tim Graham and Simon Charette for the reviews.
* Refs #23919 -- Removed python_2_unicode_compatible decorator usageClaude Paroz2017-01-181-11/+0
|