summaryrefslogtreecommitdiff
path: root/tests/annotations
Commit message (Collapse)AuthorAgeFilesLines
* Fixed #34437 -- Made values() resolving error mention selected annotations.Simon Charette2023-03-251-0/+11
| | | | | While the add_fields() call from set_values() does trigger validation it does so after annotations are masked resulting in them being excluded from the choices of valid options surfaced through a FieldError.
* Fixed #34254 -- Fixed return value of Exists() with empty queryset.Raj Desai2023-01-261-0/+8
| | | | Thanks Simon Charette for reviews.
* Refs #33374 -- Adjusted full match condition handling.Simon Charette2022-11-071-2/+17
| | | | | | Adjusting WhereNode.as_sql() to raise an exception when encoutering a full match just like with empty matches ensures that all case are explicitly handled.
* Refs #17144 -- Removed support for grouping by primary key.Simon Charette2022-11-071-15/+0
| | | | | No core backend require the feature anymore as it was only added to support a MySQL'ism that has been deprecated since then.
* Refs #33990 -- Renamed TransactionTestCase.assertQuerysetEqual() to ↵Gregor Gärtner2022-10-081-10/+10
| | | | | | assertQuerySetEqual(). Co-Authored-By: Michael Howitz <mh@gocept.com>
* Fixed #33975 -- Fixed __in lookup when rhs is a queryset with annotate() and ↵DevilsAutumn2022-09-091-0/+28
| | | | | | alias(). This fixes clearing selected fields.
* 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.
* Fixed CVE-2022-28346 -- Protected QuerySet.annotate(), aggregate(), and ↵Mariusz Felisiak2022-04-111-0/+43
| | | | | | | | extra() against SQL injection in column aliases. Thanks Splunk team: Preston Elder, Jacob Davis, Jacob Moore, Matt Hanson, David Briggs, and a security researcher: Danylo Dmytriiev (DDV_UA) for the report.
* Refs #33397 -- Added extra tests for resolving an output_field of ↵Luke Plant2022-03-301-0/+1
| | | | CombinedExpression.
* Refs #33476 -- Refactored code to strictly match 88 characters line length.Mariusz Felisiak2022-02-071-2/+8
|
* Refs #33476 -- Reformatted code with Black.django-bot2022-02-072-462/+778
|
* Refs #33476 -- Refactored problematic code before reformatting by Black.Mariusz Felisiak2022-02-031-6/+2
| | | | | | | | | | | | | | | | | 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 #33374 -- Fixed ExpressionWrapper annotations with full queryset.David Wobrock2021-12-211-0/+20
|
* Fixed #33018 -- Fixed annotations with empty queryset.David Wobrock2021-09-291-0/+6
| | | | Thanks Simon Charette for the review and implementation idea.
* Used more specific unittest assertions in tests.Mads Jensen2021-07-071-1/+1
|
* Refs #31369 -- Removed models.NullBooleanField per deprecation timeline.Mariusz Felisiak2021-01-141-4/+2
|
* Fixed #32178 -- Allowed database backends to skip tests and mark expected ↵Hasan Ramezani2020-12-101-21/+0
| | | | | failures. Co-authored-by: Tim Graham <timograham@gmail.com>
* Fixed #25534, Fixed #31639 -- Added support for transform references in ↵Ian Foote2020-11-271-10/+99
| | | | | | expressions. Thanks Mariusz Felisiak and Simon Charette for reviews.
* Fixed #32200 -- Fixed grouping by ExpressionWrapper() with Q objects.Hasan Ramezani2020-11-191-0/+12
| | | | | | Thanks Gordon Wrigley for the report. Regression in df32fd42b84cc6dbba173201f244491b0d154a63.
* Fixed #32152 -- Fixed grouping by subquery aliases.Christian Klus2020-10-291-1/+20
| | | | | | Regression in 42c08ee46539ef44f8658ebb1cbefb408e0d03fe. Thanks Simon Charette for the review.
* Refs #32007 -- Skipped test_q_expression_annotation_with_aggregation on Oracle.Mariusz Felisiak2020-09-161-0/+1
|
* Fixed #32007 -- Fixed queryset crash with Q() annotation and aggregation.Mariusz Felisiak2020-09-151-0/+11
| | | | | Thanks Gordon Wrigley for the report. Regression in 8a6df55f2dd5131282084a4edfd48f63fbf8c69a.
* Fixed #31888 -- Avoided module-level MySQL queries in tests.Ahmad A. Hussein2020-08-171-6/+5
|
* Fixed #27719 -- Added QuerySet.alias() to allow creating reusable aliases.Alexandr Tatarinov2020-07-311-1/+223
| | | | | | | | QuerySet.alias() allows creating reusable aliases for expressions that don't need to be selected but are used for filtering, ordering, or as a part of complex expressions. Thanks Simon Charette for reviews.
* Bumped minimum isort version to 5.1.0.David Smith2020-07-301-0/+1
| | | | | Fixed inner imports per isort 5. isort 5.0.0 to 5.1.0 was unstable.
* Refs #30446 -- Removed unnecessary Value(..., output_field) in docs and tests.Simon Charette2020-07-151-15/+9
|
* Fixed #31773 -- Fixed preserving output_field in ExpressionWrapper for ↵Mariusz Felisiak2020-07-091-2/+10
| | | | | | | | combined expressions. Thanks Thodoris Sotiropoulos for the report and Simon Charette for the implementation idea. Regression in df32fd42b84cc6dbba173201f244491b0d154a63.
* Fixed #31659 -- Made ExpressionWrapper preserve output_field for combined ↵Mariusz Felisiak2020-06-121-0/+8
| | | | | | | | expressions. Regression in df32fd42b84cc6dbba173201f244491b0d154a63. Thanks Simon Charette for the review.
* Fixed #31660 -- Fixed queryset crash when grouping by m2o relation.Mariusz Felisiak2020-06-081-3/+24
| | | | | Regression in 3a941230c85b2702a5e1cd97e17251ce21057efa. Thanks Tomasz Szymański for the report.
* Fixed #31584 -- Fixed crash when chaining values()/values_list() after ↵Mariusz Felisiak2020-05-141-3/+0
| | | | | | | | Exists() annotation and aggregation on Oracle. Oracle requires the EXISTS expression to be wrapped in a CASE WHEN in the GROUP BY clause. Regression in efa1908f662c19038a944129c81462485c4a9fe8.
* Fixed #31566 -- Fixed aliases crash when chaining values()/values_list() ↵Simon Charette2020-05-141-2/+18
| | | | | | | | | | | after annotate() with aggregations and subqueries. Subquery annotation references must be resolved if they are excluded from the GROUP BY clause by a following .values() call. Regression in fb3f034f1c63160c0ff13c609acd01c18be12f80. Thanks Makina Corpus for the report.
* Removed unused __str__() methods in tests models.Mariusz Felisiak2020-04-301-5/+0
| | | Follow up to 6461583b6cc257d25880ef9a9fd7e2125ac53ce1.
* Removed unused __str__() methods in tests models.Author: Mads Jensen2020-04-151-21/+0
| | | | | Co-Authored-By: Mariusz Felisiak <felisiak.mariusz@gmail.com> Co-Authored-By: Hasan Ramezani <hasan.r67@gmail.com>
* Relaxed some query ordering assertions in tests.Tim Graham2019-11-181-1/+1
| | | It accounts for differences seen on cockroachdb.
* Fixed #28289 -- Fixed crash of RawSQL annotations on inherited model fields.can2019-07-112-0/+23
|
* Refs #29542, #30158 -- Enabled a HAVING subquery filter test on Oracle.Simon Charette2019-03-211-1/+0
| | | | | Now that subquery annotations aren't included in the GROUP BY unless explicitly grouped against, the test works on Oracle.
* Fixed #29542 -- Fixed invalid SQL if a Subquery from the HAVING clause is ↵Mariusz Felisiak2018-07-141-1/+14
| | | | | used in the GROUP BY clause. Thanks Tim Graham for the review.
* Fixed #29530 -- Fixed aliases ordering when chaining annotate() and filter().Mariusz Felisiak2018-07-021-0/+16
|
* Fixed #29416 -- Removed unnecesary subquery from GROUP BY clause on MySQL ↵Mariusz Felisiak2018-05-271-0/+12
| | | | | when using a RawSQL annotation. Regression in 1d070d027c218285b66c0bde8079034b33a87f11.
* Fixed #29227 -- Allowed BooleanField to be null=True.Tim Graham2018-03-201-1/+3
| | | | Thanks Lynn Cyrin for contributing to the patch, and Nick Pope for review.
* Fixed hanging indentation in various code.Mariusz Felisiak2018-03-161-4/+6
|
* Fixed #28811 -- Fixed crash when combining regular and group by annotations.Robin Ramael2018-01-031-0/+18
|
* Refs #23941 -- Prevented incorrect rounding of DecimalField annotations on ↵Sergey Fedoseev2017-12-211-0/+14
| | | | SQLite.
* Refs #18247 -- Fixed filtering on ↵Sergey Fedoseev2017-08-101-0/+4
| | | | CombinedExpression(output_field=DecimalField()) annotation on SQLite.
* Fixed #28277 -- Added validation of QuerySet.annotate() and aggregate() args.Mariusz Felisiak2017-06-291-0/+9
| | | Thanks Tim Graham and Nick Pope for reviews.
* Refs #23968 -- Removed unnecessary lists, generators, and tuple calls.Jon Dufresne2017-06-011-1/+1
|
* Fixed #25414 -- Fixed QuerySet.annotate() with pk in values() on MySQL.Mariusz Felisiak2017-03-291-0/+6
| | | Thanks Tim Graham and Simon Charette for the reviews.
* Fixed #27800 -- Fixed QuerySet.annotate(Length(...)).distinct() crash.Lex Berezhny2017-01-311-1/+6
|
* Refs #23919 -- Removed six.PY2/PY3 usageClaude Paroz2017-01-181-2/+1
| | | | Thanks Tim Graham for the review.
* Refs #23919 -- Removed python_2_unicode_compatible decorator usageClaude Paroz2017-01-181-9/+0
|