summaryrefslogtreecommitdiff
path: root/tests/aggregation_regress
AgeCommit message (Collapse)Author
2020-11-04Fixed #32168 -- Removed serial pk assumption in aggregation_regress tests.Christopher Wang
2020-11-04Refs #32168 -- Fixed Publisher assertions in AggregationTests.test_more_more.Christopher Wang
Refer to Publisher objects instead of Books. Test regression in 1bf25e9bc6df6c2ae4c0b10fb839e101471e8373.
2020-11-04Fixed #31910 -- Fixed crash of GIS aggregations over subqueries.Simon Charette
Regression was introduced by fff5186 but was due a long standing issue. AggregateQuery was abusing Query.subquery: bool by stashing its compiled inner query's SQL for later use in its compiler which made select_format checks for Query.subquery wrongly assume the provide query was a subquery. This patch prevents that from happening by using a dedicated inner_query attribute which is compiled at a later time by SQLAggregateCompiler. Moving the inner query's compilation to SQLAggregateCompiler.compile had the side effect of addressing a long standing issue with aggregation subquery pushdown which prevented converters from being run. This is now fixed as the aggregation_regress adjustments demonstrate. Refs #25367. Thanks Eran Keydar for the report.
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-04-30Removed unused __str__() methods in tests models.Mariusz Felisiak
Follow up to 6461583b6cc257d25880ef9a9fd7e2125ac53ce1.
2020-02-04Simplified imports from django.db and django.contrib.gis.db.Nick Pope
2019-09-10Refs #14357 -- Made Meta.ordering not affect GROUP BY queries.Mariusz Felisiak
Per deprecation timeline.
2019-09-09Fixed #28107 -- Added ↵Vojtech Bocek
DatabaseFeatures.allows_group_by_selected_pks_on_model() to allow enabling optimization for unmanaged models.
2019-08-23Fixed typos in test names and a comment.Min ho Kim
2019-08-07Corrected several typos in string literals and test names.Min ho Kim
2019-01-14Refs #28643 -- Changed Variance() to use NumericOutputFieldMixin.Nick Pope
Keeps precision instead of forcing DecimalField to FloatField.
2019-01-14Refs #28643 -- Changed StdDev() to use NumericOutputFieldMixin.Nick Pope
Keeps precision instead of forcing DecimalField to FloatField.
2019-01-14Refs #28643 -- Changed Avg() to use NumericOutputFieldMixin.Nick Pope
Keeps precision instead of forcing DecimalField to FloatField.
2019-01-09Fixed #28658 -- Added DISTINCT handling to the Aggregate class.Simon Charette
2018-12-24Fixed #30056 -- Added SQLite support for StdDev and Variance functions.Nick Pope
2018-09-13Refs #14357 -- Deprecated Meta.ordering affecting GROUP BY queries.Ramiro Morales
Thanks Ramiro Morales for contributing to the patch.
2018-04-12Fixed #29320 -- Added an exception when an annotation alias matches a ↵Flávio Juvenal
ForeignKey attname.
2018-01-26Fixed #29067 -- Fixed regression in QuerySet.values_list(..., flat=True) ↵Jon Dufresne
followed by annotate().
2017-07-29Used assertRaisesMessage() to test Django's error messages.Mads Jensen
2017-05-11Fixed #28107 -- Disabled grouping of selected primary keys for unmanaged models.Simon Charette
The grouping caused an issue with database views as PostgreSQL's query planer isn't smart enough to introspect primary keys through views. Django doesn't support database views but documents that unmanaged models should be used to query them. Thanks powderflask for the detailed report and investigation.
2017-01-18Refs #23919 -- Removed most of remaining six usageClaude Paroz
Thanks Tim Graham for the review.
2017-01-18Refs #23919 -- Removed python_2_unicode_compatible decorator usageClaude Paroz
2017-01-18Refs #23919 -- Removed encoding preambles and future importsClaude Paroz
2017-01-16Fixed #25307 -- Fixed QuerySet.annotate() crash with conditional expressions.Josh Smeaton
Thanks Travis Newport for the tests and Josh Smeaton for contributing to the patch.
2016-12-28Fixed #27632 -- Unified query parameters by their values on Oracle.Mariusz Felisiak
2016-11-10Refs #27392 -- Removed "Tests that", "Ensures that", etc. from test docstrings.za
2016-09-24Fixed typo in tests/aggregation_regress/tests.py.Tim Graham
2016-09-13Fixed #27203 -- Replaced assertQuerysetEqual(..., lambda o: o) with ↵Mads Jensen
assertSequenceEqual().
2016-04-08Fixed E128 flake8 warnings in tests/.Tim Graham
2016-04-04Fixed W503 flake8 warnings.Tim Graham
2016-03-28Sorted single letter imports per the latest version of isort.Tim Graham
2016-02-05Fixed #26176 -- Fixed E123 flake8 warnings.Tim Graham
2016-01-29Refs #26022 -- Used context manager version of assertRaises in tests.Hasan
2015-12-03Fixed many spelling mistakes in code, comments, and docs.Josh Soref
2015-09-12Fixed #23395 -- Limited line lengths to 119 characters.Dražen Odobašić
2015-09-11Fixed #25382 -- Removed obsolete references to DateQuerySet.Renato Oliveira
2015-08-06Refs #14476 -- Added a test for default annotation name access in aggregate.Tim Graham
Fixed in f59fd15c4928caf3dfcbd50f6ab47be409a43b01
2015-07-27Fixed #21127 -- Started deprecation toward requiring on_delete for ↵Flavio Curella
ForeignKey/OneToOneField
2015-06-30Fixed #18247 -- Added cast to NUMERIC for Decimals on sqliteMichael Tänzer
On sqlite the SUM() of a decimal column doesn't have a NUMERIC type so when comparing it to a string literal (which a Decimal gets converted to in Django) it is not compared as expected.
2015-05-11Fixed #24748 -- Fixed incorrect GROUP BY on MySQL in some queriesAnssi Kääriäinen
When the query's model had a self-referential foreign key, the compiler.get_group_by() code incorrectly used the self-referential foreign key's column (for example parent_id) as GROUP BY clause when it should have used the model's primary key column (id).
2015-03-29Fixed #19259 -- Added group by selected primary keys support.Simon Charette
2015-03-09Fixed #24171 -- Fixed failure with complex aggregate query and expressionsAnssi Kääriäinen
The query used a construct of qs.annotate().values().aggregate() where the first annotate used an F-object reference and the values() and aggregate() calls referenced that F-object. Also made sure the inner query's select clause is as simple as possible, and made sure .values().distinct().aggreate() works correctly.
2015-03-05Converted test fixtures to setUpTestData methodsJosh Smeaton
2015-02-06Sorted imports with isort; refs #23860.Tim Graham
2015-01-30Fixed #24211 -- Removed ValuesQuerySet() and ValuesListQuerySet().Loic Bistuer
Thanks Anssi Kääriäinen, Marc Tamlyn, and Tim Graham for the reviews.
2015-01-08Fixed #24020 -- Refactored SQL compiler to use expressionsAnssi Kääriäinen
Refactored compiler SELECT, GROUP BY and ORDER BY generation. While there, also refactored select_related() implementation (get_cached_row() and get_klass_info() are now gone!). Made get_db_converters() method work on expressions instead of internal_type. This allows the backend converters to target specific expressions if need be. Added query.context, this can be used to set per-query state. Also changed the signature of database converters. They now accept context as an argument.
2014-11-27Fixed #23877 -- aggregation's subquery missed target colAnssi Kääriäinen
Aggregation over subquery produced syntactically incorrect queries in some cases as Django didn't ensure that source expressions of the aggregation were present in the subquery.
2014-11-03Fixed #23620 -- Used more specific assertions in the Django test suite.Berker Peksag
2014-10-16Fixed #23659 -- Kept annotate() args orderingClaude Paroz
Thanks Loic Bistuer and Simon Charette for the review.