summaryrefslogtreecommitdiff
path: root/tests/expressions
AgeCommit message (Collapse)Author
2021-02-19[3.2.x] Fixed #32455 -- Allowed right combining Q() with boolean expressions.Hasan Ramezani
Backport of f2bef2b7bc6c817af0f5fa77e1052a1f5ce12f71 from master
2021-02-19[3.2.x] Refs #32455 -- Added tests for left combining an empty Q() with ↵Mariusz Felisiak
boolean expressions. Backport of efce21497cc21140c5fe2b133064cd815c97b3f5 from master
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
2020-07-01Refs #28621 -- Fixed crash of annotations with nested OuterRef.Sergey Fedoseev
2020-06-30Fixed #28925 -- Fixed durations-only expressions crash on SQLite and MySQL.Sergey Fedoseev
This removes also unused DatabaseOperations.date_interval_sql().
2020-06-12Fixed #31659 -- Made ExpressionWrapper preserve output_field for combined ↵Mariusz Felisiak
expressions. Regression in df32fd42b84cc6dbba173201f244491b0d154a63. Thanks Simon Charette for the review.
2020-06-03Fixed #31651 -- Made ExpressionWrapper use grouping columns from wrapped ↵Thodoris Sotiropoulos
expression.
2020-05-19Fixed #31607 -- Fixed evaluated Subquery equality.Mariusz Felisiak
Regression in 691def10a0197d83d2d108bd9043b0916d0f09b4.
2020-05-04Changed `'%s' % value` pattern to `str(value)`.Nick Pope
2020-04-30Removed unused __str__() methods in tests models.Mariusz Felisiak
Follow up to 6461583b6cc257d25880ef9a9fd7e2125ac53ce1.
2020-04-06Fixed #31420 -- Fixed crash when filtering subquery annotation against a ↵Hasan Ramezani
SimpleLazyObject. Thanks Simon Charette for the solution and analysis.
2020-04-04Fixed #31415 -- Fixed crash when nested OuterRef is used with operators or ↵Hasan Ramezani
in database functions.
2020-03-25Removed unnecessary assertions in ExpressionOperatorTests.Mariusz Felisiak
These tests don't modify Number.float field.
2020-03-25Fixed #31396 -- Added binary XOR operator to F expressions.Hannes Ljungberg
2020-02-27Fixed #31251 -- Disabled grouping by OuterRef() annotation.Rohit
2020-02-27Fixed #31312 -- Properly ordered temporal subtraction params on MySQL.Simon Charette
Regression in 9bcbcd599abac91ea853b2fe10b784ba32df043e. Thanks rick2ricks for the report.
2020-02-04Simplified imports from django.db and django.contrib.gis.db.Nick Pope
2020-01-03Fixed #31133 -- Fixed crash when subtracting against a subquery annotation.Simon Charette
The subtract_temporals() database operation was not handling expressions returning SQL params in mixed database types. Regression in 35431298226165986ad07e91f9d3aca721ff38ec. Thanks Reupen Shah for the report.
2019-12-23Refs #31115 -- Added test for nested subquery that references related fields.Mariusz Felisiak
Thanks Dmitriy Gunchenko for the report and Simon Charette for the analysis and tests. Regression in 5a4d7285bd10bd40d9f7e574a7c421eb21094858. Fixed in 5a4d7285bd10bd40d9f7e574a7c421eb21094858.
2019-11-18Fixed #30986 -- Fixed queryset crash when filtering against boolean RawSQL ↵Mariusz Felisiak
expressions on Oracle.
2019-10-02Fixed some typos in comments and docs.Min ho Kim
Thanks to Mads Jenson for review.
2019-10-01Fixed #30651 -- Made __eq__() methods return NotImplemented for not ↵ElizabethU
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.
2019-08-29Fixed #25367 -- Allowed boolean expressions in QuerySet.filter() and exclude().Matthew Schinckel
This allows using expressions that have an output_field that is a BooleanField to be used directly in a queryset filters, or in the When() clauses of a Case() expression. Thanks Josh Smeaton, Tim Graham, Simon Charette, Mariusz Felisiak, and Adam Johnson for reviews. Co-Authored-By: NyanKiyoshi <hello@vanille.bid>
2019-08-29Used skipUnlessDBFeature instead of checking vendor in ↵Mariusz Felisiak
test_filtering_on_annotate_that_uses_q.
2019-07-10Fixed #30628 -- Adjusted expression identity to differentiate bound fields.Simon Charette
Expressions referring to different bound fields should not be considered equal. Thanks Julien Enselme for the detailed report. Regression in bc7e288ca9554ac1a0a19941302dea19df1acd21.
2019-06-21Fixed typo in BasicExpressionsTests.test_object_update_fk() test.Mariusz Felisiak
2019-05-03Fixed #29692 -- Fixed removing ordering parts for multiline RawSQL expressions.can
2019-04-19Refs #25507 -- Added tests for using QuerySet.count() with a RawSQL annotation.Mariusz Felisiak
Fixed in 3f32154f40a855afa063095e3d091ce6be21f2c5
2019-03-27Fixed #28621 -- Fixed crash of annotations with OuterRef.Mariusz Felisiak
2019-03-23Refs #30188 -- Avoided GROUP BY when aggregating over non-aggregates.Simon Charette
2019-03-23Refs #30188 -- Prevented double annotation of subquery when aggregated over.Simon Charette
Thanks Can Sarıgöl for the suggested trimming approach.
2019-03-23Fixed #30188 -- Fixed a crash when aggregating over a subquery annotation.Simon Charette
2019-03-21Refs #30158 -- Added alias argument to Expression.get_group_by_cols().Simon Charette
2019-02-14Fixed #29619 -- Added field names to some FieldErrors.Hasan Ramezani
2019-01-16Fixed #30044 -- Raised a FieldError on inherited field update attempts.Simon Charette
2019-01-16Removed unnecessary transaction wrapping in expressions test.Simon Charette
2019-01-15Fixed #30099 -- Fixed invalid SQL when filtering a Subquery by an aggregate.Nasir Hussain
2019-01-09Fixed #28658 -- Added DISTINCT handling to the Aggregate class.Simon Charette