summaryrefslogtreecommitdiff
path: root/tests/expressions
AgeCommit message (Collapse)Author
2023-01-16Refs #30129 -- Added test for create() with F() expression in Subquery.sarahboyce
Fixed in 35431298226165986ad07e91f9d3aca721ff38ec.
2022-10-31Fixed #16211 -- Added logical NOT support to F expressions.David Wobrock
2022-10-08Refs #33990 -- Renamed TransactionTestCase.assertQuerysetEqual() to ↵Gregor Gärtner
assertQuerySetEqual(). Co-Authored-By: Michael Howitz <mh@gocept.com>
2022-10-06Refs #30158 -- Removed alias argument for Expression.get_group_by_cols().Simon Charette
Recent refactors allowed GROUP BY aliasing allowed for aliasing to be entirely handled by the sql.Query.set_group_by and compiler layers.
2022-09-27Fixed #33464 -- Resolved output_field for combined numeric expressions with ↵David Wobrock
MOD operator.
2022-05-12Fixed #33543 -- Deprecated passing nulls_first/nulls_last=False to OrderBy ↵Mariusz Felisiak
and Expression.asc()/desc(). Thanks Allen Jonathan David for the initial patch.
2022-04-14Relaxed some query ordering assertions in various tests.Mariusz Felisiak
It accounts for differences seen on MySQL with MyISAM storage engine.
2022-04-11Fixed CVE-2022-28346 -- Protected QuerySet.annotate(), aggregate(), and ↵Mariusz Felisiak
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.
2022-03-31Fixed #33397 -- Corrected resolving output_field for ↵Luke Plant
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
2022-03-30Refs #33397 -- Added extra tests for resolving an output_field of ↵Luke Plant
CombinedExpression.
2022-03-04Fixed #29865 -- Added logical XOR support for Q() and querysets.Ryan Heard
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
2022-02-07Refs #33482 -- Fixed QuerySet selecting and filtering againts negated ↵Mariusz Felisiak
Exists() with empty queryset. Regression in b7d1da5a62fe4141beff2bfea565f7ef0038c94c.
2022-02-03Refs #33476 -- Refactored problematic code before reformatting by Black.Mariusz Felisiak
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], )
2022-02-02Fixed #33482 -- Fixed QuerySet filtering againts negated Exists() with empty ↵Simon Charette
queryset. Thanks Tobias Bengfort for the report.
2022-01-17Fixed #33435 -- Fixed invalid SQL generatered by Subquery.as_sql().My-Name-Is-Nabil
2022-01-07Fixed #33216 -- Simpilified deconstructed paths for some expressions.Allen Jonathan David
2022-01-04Fixed #33406 -- Avoided creation of MaxLengthValidator(None) when resolving ↵Keryn Knight
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.
2022-01-04Refs #33406 -- Added test for not creating broken validators when resolving ↵Keryn Knight
Value.output_field.
2021-12-22Refs #33355 -- Added missing tests for database functions and expression on ↵Adam Johnson
null values.
2021-11-08Fixed #33257 -- Fixed Case() and ExpressionWrapper() with decimal values on ↵Matthijs Kooijman
SQLite.
2021-11-02Fixed #33224 -- Removed ↵Hasan Ramezani
DatabaseFeatures.supports_mixed_date_datetime_comparisons.
2021-10-26Removed duplicated lines in ↵Tim Graham
test_in_lookup_allows_F_expressions_and_expressions_for_datetimes().
2021-10-21Made F deconstruction omit 'expressions' in the path.Adam Johnson
2021-06-01Fixed #32793 -- Fixed loss of precision for temporal operations with ↵Mariusz Felisiak
DecimalFields on MySQL. Regression in 1e38f1191de21b6e96736f58df57dfb851a28c1f. Thanks Mohsen Tamiz for the report.
2021-05-24Refs #24121 -- Improved Value.__repr__().Mariusz Felisiak
2021-05-24Fixed typo in tests/expressions/tests.py.Mariusz Felisiak
2021-05-05Fixed #32714 -- Prevented recreation of migration for Meta.ordering with ↵Simon Charette
OrderBy expressions. Regression in c8b659430556dca0b2fe27cf2ea0f8290dbafecd. Thanks Kevin Marsh for the report.
2021-04-20Refs #25287 -- Added support for multiplying and dividing DurationField by ↵Tobias Bengfort
scalar values on SQLite.
2021-03-29Fixed #32585 -- Fixed Value() crash with DecimalField on SQLite.Hasan Ramezani
2021-03-17Fixed #32548 -- Fixed crash when combining Q() objects with boolean expressions.Jonathan Richards
2021-03-17Refs #32548 -- Added tests for passing conditional expressions to Q().Mariusz Felisiak
2021-02-18Fixed #32455 -- Allowed right combining Q() with boolean expressions.Hasan Ramezani
2021-02-18Refs #32455 -- Added tests for left combining an empty Q() with boolean ↵Mariusz Felisiak
expressions.
2021-01-26Refs #26602 -- Added tests for aggregating over a RawSQL() annotation.Mariusz Felisiak
Fixed in 3f32154f40a855afa063095e3d091ce6be21f2c5. Thanks Manav Agarwal for initial test.
2021-01-14Refs #30158 -- Made alias argument required in signature of ↵Mariusz Felisiak
Expression.get_group_by_cols() subclasses. Per deprecation timeline.
2020-12-10Fixed #32178 -- Allowed database backends to skip tests and mark expected ↵Hasan Ramezani
failures. Co-authored-by: Tim Graham <timograham@gmail.com>
2020-11-27Fixed #25534, Fixed #31639 -- Added support for transform references in ↵Ian Foote
expressions. Thanks Mariusz Felisiak and Simon Charette for reviews.
2020-11-06Fixed #31235 -- Made assertQuerysetEqual() compare querysets directly.Hasan Ramezani
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>
2020-10-23Fixed #32134 -- Fixed crash of __range lookup with namedtuple.Adam Johnson
Regression in 8be79984dce7d819879a6e594ca69c5f95a08378. Thanks Gordon Wrigley for the report.
2020-10-19Relaxed some query ordering assertions in expressions tests.Tim Graham
It accounts for differences seen on CockroachDB.
2020-10-02Fixed #32060 -- Added Random database function.Nick Pope
2020-08-31Fixed #31919 -- Resolved output_field of IntegerField subclasses combinations.Simon Charette
2020-08-31Refs #30446 -- Added tests for resolving output_field of CombinedExpression.Simon Charette
2020-08-13Fixed #31792 -- Made Exists() reuse QuerySet.exists() optimizations.Simon Charette
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.
2020-07-15Refs #30446 -- Removed unnecessary Value(..., output_field) in docs and tests.Simon Charette
2020-07-15Fixed #30446 -- Resolved Value.output_field for stdlib types.Simon Charette
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.
2020-07-14Refs #25425 -- Allowed unresolved Value() instances to be compiled.Simon Charette
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.
2020-07-01Fixed #31755 -- Made temporal subtraction resolve output field.Sergey Fedoseev