summaryrefslogtreecommitdiff
path: root/tests/expressions
Commit message (Collapse)AuthorAgeFilesLines
* Refs #33543 -- Made Expression.asc()/desc() and OrderBy raise ValueError ↵Mariusz Felisiak2023-01-171-12/+5
| | | | | | when nulls_first/nulls_last=False is passed. Per deprecation timeline.
* Refs #30129 -- Added test for create() with F() expression in Subquery.sarahboyce2023-01-161-0/+18
| | | | Fixed in 35431298226165986ad07e91f9d3aca721ff38ec.
* Fixed #16211 -- Added logical NOT support to F expressions.David Wobrock2022-10-311-0/+56
|
* Refs #33990 -- Renamed TransactionTestCase.assertQuerysetEqual() to ↵Gregor Gärtner2022-10-081-10/+10
| | | | | | assertQuerySetEqual(). Co-Authored-By: Michael Howitz <mh@gocept.com>
* Refs #30158 -- Removed alias argument for Expression.get_group_by_cols().Simon Charette2022-10-061-2/+2
| | | | | Recent refactors allowed GROUP BY aliasing allowed for aliasing to be entirely handled by the sql.Query.set_group_by and compiler layers.
* Fixed #33464 -- Resolved output_field for combined numeric expressions with ↵David Wobrock2022-09-271-1/+7
| | | | MOD operator.
* Fixed #33543 -- Deprecated passing nulls_first/nulls_last=False to OrderBy ↵Mariusz Felisiak2022-05-121-2/+20
| | | | | and Expression.asc()/desc(). Thanks Allen Jonathan David for the initial patch.
* Relaxed some query ordering assertions in various tests.Mariusz Felisiak2022-04-141-2/+2
| | | 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/+9
| | | | | | | | 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.
* Fixed #33397 -- Corrected resolving output_field for ↵Luke Plant2022-03-311-4/+35
| | | | | | | | | | | | | | | | | | DateField/DateTimeField/TimeField/DurationFields. This includes refactoring of CombinedExpression._resolve_output_field() so it no longer uses the behavior inherited from Expression of guessing same output type if argument types match, and instead we explicitly define the output type of all supported operations. This also makes nonsensical operations involving dates (e.g. date + date) raise a FieldError, and adds support for automatically inferring output_field for cases such as: * date - date * date + duration * date - duration * time + duration * time - time
* Refs #33397 -- Added extra tests for resolving an output_field of ↵Luke Plant2022-03-301-1/+89
| | | | CombinedExpression.
* Fixed #29865 -- Added logical XOR support for Q() and querysets.Ryan Heard2022-03-041-1/+11
|
* Refs #33476 -- Refactored code to strictly match 88 characters line length.Mariusz Felisiak2022-02-071-3/+7
|
* Refs #33476 -- Reformatted code with Black.django-bot2022-02-073-709/+1025
|
* Refs #33482 -- Fixed QuerySet selecting and filtering againts negated ↵Mariusz Felisiak2022-02-071-0/+8
| | | | | Exists() with empty queryset. Regression in b7d1da5a62fe4141beff2bfea565f7ef0038c94c.
* Refs #33476 -- Refactored problematic code before reformatting by Black.Mariusz Felisiak2022-02-031-4/+10
| | | | | | | | | | | | | | | | | 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 #33482 -- Fixed QuerySet filtering againts negated Exists() with empty ↵Simon Charette2022-02-021-0/+7
| | | | | | queryset. Thanks Tobias Bengfort for the report.
* Fixed #33435 -- Fixed invalid SQL generatered by Subquery.as_sql().My-Name-Is-Nabil2022-01-171-0/+9
|
* Fixed #33216 -- Simpilified deconstructed paths for some expressions.Allen Jonathan David2022-01-071-2/+2
|
* Fixed #33406 -- Avoided creation of MaxLengthValidator(None) when resolving ↵Keryn Knight2022-01-041-0/+1
| | | | | | | | | Value.output_field for strings. This brings the behaviour in line with Field subclasses which append to the validators within __init__(), like BinaryField, and prevents the creation of a validator which incorrectly throws a TypeError, if it were used.
* Refs #33406 -- Added test for not creating broken validators when resolving ↵Keryn Knight2022-01-041-0/+23
| | | | Value.output_field.
* Refs #33355 -- Added missing tests for database functions and expression on ↵Adam Johnson2021-12-221-0/+12
| | | | null values.
* Fixed #33257 -- Fixed Case() and ExpressionWrapper() with decimal values on ↵Matthijs Kooijman2021-11-081-0/+7
| | | | SQLite.
* Fixed #33224 -- Removed ↵Hasan Ramezani2021-11-021-1/+0
| | | | DatabaseFeatures.supports_mixed_date_datetime_comparisons.
* Removed duplicated lines in ↵Tim Graham2021-10-261-5/+0
| | | | test_in_lookup_allows_F_expressions_and_expressions_for_datetimes().
* Made F deconstruction omit 'expressions' in the path.Adam Johnson2021-10-211-1/+1
|
* Fixed #32793 -- Fixed loss of precision for temporal operations with ↵Mariusz Felisiak2021-06-012-1/+9
| | | | | | | DecimalFields on MySQL. Regression in 1e38f1191de21b6e96736f58df57dfb851a28c1f. Thanks Mohsen Tamiz for the report.
* Refs #24121 -- Improved Value.__repr__().Mariusz Felisiak2021-05-241-1/+17
|
* Fixed typo in tests/expressions/tests.py.Mariusz Felisiak2021-05-241-2/+2
|
* Fixed #32714 -- Prevented recreation of migration for Meta.ordering with ↵Simon Charette2021-05-051-0/+22
| | | | | | | | OrderBy expressions. Regression in c8b659430556dca0b2fe27cf2ea0f8290dbafecd. Thanks Kevin Marsh for the report.
* Refs #25287 -- Added support for multiplying and dividing DurationField by ↵Tobias Bengfort2021-04-202-0/+31
| | | | scalar values on SQLite.
* Fixed #32585 -- Fixed Value() crash with DecimalField on SQLite.Hasan Ramezani2021-03-291-0/+5
|
* Fixed #32548 -- Fixed crash when combining Q() objects with boolean expressions.Jonathan Richards2021-03-171-0/+4
|
* Refs #32548 -- Added tests for passing conditional expressions to Q().Mariusz Felisiak2021-03-171-0/+6
|
* Fixed #32455 -- Allowed right combining Q() with boolean expressions.Hasan Ramezani2021-02-181-0/+10
|
* Refs #32455 -- Added tests for left combining an empty Q() with boolean ↵Mariusz Felisiak2021-02-181-0/+12
| | | | expressions.
* Refs #26602 -- Added tests for aggregating over a RawSQL() annotation.Mariusz Felisiak2021-01-261-0/+12
| | | | | Fixed in 3f32154f40a855afa063095e3d091ce6be21f2c5. Thanks Manav Agarwal for initial test.
* Refs #30158 -- Made alias argument required in signature of ↵Mariusz Felisiak2021-01-141-24/+0
| | | | | | Expression.get_group_by_cols() subclasses. Per deprecation timeline.
* Fixed #32178 -- Allowed database backends to skip tests and mark expected ↵Hasan Ramezani2020-12-101-2/+0
| | | | | failures. Co-authored-by: Tim Graham <timograham@gmail.com>
* Fixed #25534, Fixed #31639 -- Added support for transform references in ↵Ian Foote2020-11-271-1/+9
| | | | | | expressions. Thanks Mariusz Felisiak and Simon Charette for reviews.
* Fixed #31235 -- Made assertQuerysetEqual() compare querysets directly.Hasan Ramezani2020-11-061-72/+56
| | | | | | | | 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>
* Fixed #32134 -- Fixed crash of __range lookup with namedtuple.Adam Johnson2020-10-231-1/+9
| | | | | | Regression in 8be79984dce7d819879a6e594ca69c5f95a08378. Thanks Gordon Wrigley for the report.
* Relaxed some query ordering assertions in expressions tests.Tim Graham2020-10-191-5/+5
| | | It accounts for differences seen on CockroachDB.
* Fixed #32060 -- Added Random database function.Nick Pope2020-10-021-2/+1
|
* Fixed #31919 -- Resolved output_field of IntegerField subclasses combinations.Simon Charette2020-08-311-2/+4
|
* Refs #30446 -- Added tests for resolving output_field of CombinedExpression.Simon Charette2020-08-311-1/+23
|
* Fixed #31792 -- Made Exists() reuse QuerySet.exists() optimizations.Simon Charette2020-08-131-1/+21
| | | | | | The latter is already optimized to limit the number of results, avoid selecting unnecessary fields, and drop ordering if possible without altering the semantic of the query.
* Refs #30446 -- Removed unnecessary Value(..., output_field) in docs and tests.Simon Charette2020-07-151-3/+3
|
* Fixed #30446 -- Resolved Value.output_field for stdlib types.Simon Charette2020-07-151-5/+33
| | | | | | This required implementing a limited form of dynamic dispatch to combine expressions with numerical output. Refs #26355 should eventually provide a better interface for that.
* Refs #25425 -- Allowed unresolved Value() instances to be compiled.Simon Charette2020-07-141-0/+8
| | | | | | | | | | Previously unresolved Value() instances were only allowed to be compiled if they weren't initialized with an output_field. Given the usage of unresolved Value() instances is relatively common in as_sql() overrides it's less controversial to add explicit support for this previously undefined behavior now and revisit whether or not it should be deprecated in the future.