summaryrefslogtreecommitdiff
path: root/tests/db_functions
AgeCommit message (Collapse)Author
2026-03-13Refs #36735 -- Adjusted UUID7 assertions for timezone shifts.Mariusz Felisiak
Thanks Simon Charette and Jacob Walls for reviews.
2026-01-20Refs #36639 -- Updated test migrations to match models.Skyiesac
2025-12-12Refs #36735 -- Supported shift parameter for UUID7 on PostgreSQL.Lily Acorn
2025-12-12Fixed #36735 -- Added UUID4 and UUID7 database functions.Lily Acorn
Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2025-02-18Refs #36005 -- Used datetime.UTC alias instead of datetime.timezone.utc.Mariusz Felisiak
datetime.UTC was added in Python 3.11.
2025-02-15Fixed #36173 -- Stabilized identity of Concat with an explicit output_field.Simon Charette
When Expression.__init__() overrides make use of *args, **kwargs captures their argument values are respectively bound as a tuple and dict instances. These composite values might themselves contain values that require special identity treatments such as Concat(output_field) as it's a Field instance. Refs #30628 which introduced bound Field differentiation but lacked argument captures handling. Thanks erchenstein for the report.
2025-01-06Fixed #35718 -- Add JSONArray to django.db.models.functions.John Parton
Co-authored-by: Sarah Boyce <42296566+sarahboyce@users.noreply.github.com> Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2024-12-18Added DatabaseFeatures.rounds_to_even.Tim Graham
This feature flag useful with MongoDB: "Rounding to the nearest even value supports more even distribution of rounded data than always rounding up or down."
2024-12-16Refs #35718, Refs #32179 -- Moved JSONObject to django.db.models.functions.json.Sage Abdullah
2024-02-15Fixed #33037 -- Fixed Trunc() with offset timezones on MySQL, SQLite, Oracle.Shafiya Adzhani
2024-02-15Improved test helpers in truncated date/time field tests.Shafiya Adzhani
Co-authored-by: Lily Foote <code@lilyf.org>
2024-01-26Applied Black's 2024 stable style.Mariusz Felisiak
https://github.com/psf/black/releases/tag/24.1.0
2023-12-12Fixed #34013 -- Added QuerySet.order_by() support for annotation transforms.Simon Charette
Thanks Eugene Morozov and Ben Nace for the reports.
2023-11-14Fixed #34955 -- Made Concat() use || operator on PostgreSQL.Simon Charette
This also avoids casting string based expressions in Concat() on PostgreSQL.
2023-05-31Fixed #34606 -- Fixed Right() function with zero length on Oracle and SQLite.Kacper Wolkiewicz
2023-05-10Fixed #34554 -- Fixed Reverse(Value(…)) crash on Oracle.Mariusz Felisiak
2023-04-11Fixed #34480 -- Fixed crash of annotations with Chr().Jacob Walls
2023-03-14Refs #28329 -- Fixed Cast() with ForeignKey to integer fields on MySQL.David Wobrock
2023-02-01Refs #33476 -- Applied Black's 2023 stable style.David Smith
Black 23.1.0 is released which, as the first release of the year, introduces the 2023 stable style. This incorporates most of last year's preview style. https://github.com/psf/black/releases/tag/23.1.0
2023-01-18Fixed #34233 -- Dropped support for Python 3.8 and 3.9.Mariusz Felisiak
2023-01-17Refs #32365 -- Removed support for pytz timezones per deprecation timeline.Mariusz Felisiak
2022-12-15Fixed #33308 -- Added support for psycopg version 3.Daniele Varrazzo
Thanks Simon Charette, Tim Graham, and Adam Johnson for reviews. Co-authored-by: Florian Apolloner <florian@apolloner.eu> Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2022-10-08Refs #33990 -- Renamed TransactionTestCase.assertQuerysetEqual() to ↵Gregor Gärtner
assertQuerySetEqual(). Co-Authored-By: Michael Howitz <mh@gocept.com>
2022-10-03Fixed #34070 -- Added subsecond support to Now() on SQLite and MySQL.Lily Foote
2022-08-24Refs #27412 -- Confirmed support for executing Coalesce(subquery).Simon Charette
This has been supported for subqueries wrapped in Subquery since the expression was introduced and for Queryset directly since Subquery resolves to sql.Query. Piggy-backed on the existing tests covering Coalesce handling of EmptyResultSet as it seemed like a proper location to combine testing.
2022-07-26Refs #27236 -- Reverted "Refs #27236 -- Added generic mechanism to handle ↵Mariusz Felisiak
the deprecation of migration operations." This reverts commit 41019e48bbf082c985e6ba3bad34d118b903bff1.
2022-07-08Refs #27236 -- Added generic mechanism to handle the deprecation of ↵David Wobrock
migration operations.
2022-07-06Refs CVE-2022-34265 -- Properly escaped Extract() and Trunc() parameters.Simon Charette
Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2022-07-04Fixed CVE-2022-34265 -- Protected Trunc(kind)/Extract(lookup_name) against ↵Mariusz Felisiak
SQL injection. Thanks Takuto Yoshikai (Aeye Security Lab) for the report.
2022-04-14Relaxed some query ordering assertions in various tests.Mariusz Felisiak
It accounts for differences seen on MySQL with MyISAM storage engine.
2022-03-24Refs #32365 -- Removed internal uses of utils.timezone.utc alias.Carlton Gibson
Remaining test case ensures that uses of the alias are mapped canonically by the migration writer.
2022-02-22Refs #33517 -- Prevented __second lookup from returning fractional seconds ↵nabil-rady
on PostgreSQL.
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
2021-12-22Refs #33355 -- Added missing tests for database functions and expression on ↵Adam Johnson
null values.
2021-12-13Refs #33355 -- Fixed Trunc() with years < 1000 on SQLite.Adam Johnson
Thanks to Nick Pope for spotting the bug in Code Review. Co-Authored-By: Nick Pope <nick@nickpope.me.uk>
2021-12-13Refs #33355 -- Moved Trunc() assertions for invalid arguments and ISO 8601 ↵Mariusz Felisiak
week to separate tests.
2021-11-12Fixed #33279 -- Fixed handling time zones with "-" sign in names.Can Sarigol
Thanks yakimka for the report. Regression in fde9b7d35e4e185903cc14aa587ca870037941b1.
2021-09-29Fixed #33018 -- Fixed annotations with empty queryset.David Wobrock
Thanks Simon Charette for the review and implementation idea.
2021-09-16Fixed #32365 -- Made zoneinfo the default timezone implementation.Carlton Gibson
Thanks to Adam Johnson, Aymeric Augustin, David Smith, Mariusz Felisiak, Nick Pope, and Paul Ganssle for reviews.
2021-07-15Refs #32508 -- Raised Type/ValueError instead of using "assert" in ↵Daniyal
django.db.models. Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2021-06-22Refs #32858, Refs #32392 -- Restored using :: shortcut syntax in Cast() on ↵Mariusz Felisiak
PostgreSQL. This partly reverts commit fdfbc66331292def201c9344e3cd29fbcbcd076a unnecessary since b69b0c3fe871167a0ca01bb439508e335143801f.
2021-05-17Fixed #32750 -- Fixed crash of Extract() transform on OuterRef() expressions.Artur Beltsov
Thanks Simon Charette for the review.
2021-05-11Fixed #32722 -- Fixed comparing to TruncTime() on Oracle.Mariusz Felisiak
2021-05-07Fixed #32699 -- Fixed comparing to TruncTime() with 0 microseconds on MySQL.Alex Hill
2021-03-29Fixed #31487 -- Added precision argument to Round().Nick Pope
2021-03-23Fixed #32573 -- Fixed bounds in __iso_year lookup optimization.Florian Demmer
2021-01-29Fixed #32392 -- Fixed ExclusionConstraint crash with Cast() in expressions.Tilman Koschnick
2021-01-19Refs #32365 -- Allowed use of non-pytz timezone implementations.Paul Ganssle
2020-12-10Fixed #32178 -- Allowed database backends to skip tests and mark expected ↵Hasan Ramezani
failures. Co-authored-by: Tim Graham <timograham@gmail.com>