summaryrefslogtreecommitdiff
path: root/tests/model_fields
AgeCommit message (Collapse)Author
2021-09-28[4.0.x] Fixed #33033 -- Prevented models.DecimalField from accepting NaN values.Chinmoy Chakraborty
Backport of b7fd668b37341fc92d67c4854c4f244e10895c9b from main
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-05-13Fixed #32718 -- Relaxed file name validation in FileField.Mariusz Felisiak
- Validate filename returned by FileField.upload_to() not a filename passed to the FileField.generate_filename() (upload_to() may completely ignored passed filename). - Allow relative paths (without dot segments) in the generated filename. Thanks to Jakub Kleň for the report and review. Thanks to all folks for checking this patch on existing projects. Thanks Florian Apolloner and Markus Holtermann for the discussion and implementation idea. Regression in 0b79eb36915d178aef5c6a7bbce71b1e76d376d3.
2021-04-08Fixed #32620 -- Allowed subclasses of Big/SmallAutoField for DEFAULT_AUTO_FIELD.Adam Johnson
2021-03-23Fixed #32483 -- Fixed QuerySet.values()/values_list() on JSONField key ↵Mariusz Felisiak
transforms with booleans on SQLite. Thanks Matthew Cornell for the report.
2021-03-23Refs #32483 -- Added tests QuerySet.values()/values_list() on key transforms ↵Mariusz Felisiak
with structures containing booleans.
2021-03-23Refs #31936 -- Added tests for __in lookup on JSONField key transforms with ↵Mariusz Felisiak
booleans.
2021-02-05Fixed #32411 -- Fixed __icontains lookup for JSONField on MySQL.Hasan Ramezani
2021-01-14Refs #31369 -- Removed models.NullBooleanField per deprecation timeline.Mariusz Felisiak
2020-12-11Fixed #32252 -- Fixed __isnull=True on key transforms on SQLite and Oracle.sage
__isnull=True on key transforms should not match keys with NULL values.
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-25Fixed #32203 -- Fixed QuerySet.values()/values_list() crash on key ↵sage
transforms with non-string values on SQLite. Thanks Gordon Wrigley for the report.
2020-11-25Refs #32203 -- Added tests for QuerySet.values()/values_list() on key ↵sage
transforms with non-trivial values.
2020-11-24Added test for filtering JSONField key transforms with quoted strings.Mariusz Felisiak
2020-11-10Fixed #32182 -- Fixed crash of JSONField nested key transforms with subquery ↵Hannes Ljungberg
annotations on PostgreSQL.
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-11-02Fixed #32132 -- Fixed column types in m2m intermediary tables for ↵David-Wobrock
Positive(Big/Small)IntegerFields.
2020-11-02Refs #32132 -- Added rel_db_type() tests for auto and integer fields.David-Wobrock
2020-10-22Replaced @no_oracle skips with DatabaseFeatures.allows_group_by_lob.Tim Graham
2020-10-14Refs #32096 -- Fixed ExpressionWrapper crash with JSONField key transforms.Mariusz Felisiak
Regression in 6789ded0a6ab797f0dcdfa6ad5d1cfa46e23abcd. Thanks Simon Charette and Igor Jerosimić for the report.
2020-10-14Refs #32096 -- Fixed __in lookup crash against key transforms for JSONField.Mariusz Felisiak
Regression in 6789ded0a6ab797f0dcdfa6ad5d1cfa46e23abcd and 1251772cb83aa4106f526fe00738e51c0eb59122. Thanks Simon Charette and Igor Jerosimić for the report.
2020-09-25Used assertRaisesMessage() in CharField tests.David Smith
2020-09-21Fixed #31777 -- Added support for database collations to Char/TextFields.Tom Carrick
Thanks Simon Charette and Mariusz Felisiak for reviews.
2020-09-10Refs #23130 -- Added test for BooleanField choices generation.Jacob Walls
2020-09-09Fixed #31750 -- Made models.Field equality compare models for inherited fields.Ryan Hiebert
2020-09-04Refs #31894 -- Added tests for JSONField key lookups with QuerySet.exclude().jpribyl
2020-08-28Fixed #31956 -- Fixed crash of ordering by JSONField with a custom decoder ↵Mariusz Felisiak
on PostgreSQL. Thanks Marc Debureaux for the report. Thanks Simon Charette, Nick Pope, and Adam Johnson for reviews.
2020-08-28Refs #31956 -- Added test for ordering by JSONField with a custom decoder.Mariusz Felisiak
2020-08-26Fixed #31936 -- Fixed __in lookup on key transforms for JSONField.Mariusz Felisiak
This resolves an issue on databases without a native JSONField (MariaDB, MySQL, SQLite, Oracle), where values must be wrapped. Thanks Sébastien Pattyn for the report.
2020-07-30Bumped minimum isort version to 5.1.0.David Smith
Fixed inner imports per isort 5. isort 5.0.0 to 5.1.0 was unstable.
2020-07-30Refs #31829 -- Added ↵Tim Graham
DatabaseFeatures.json_key_contains_list_matching_requires_list. CockroachDB's behavior matches PostgreSQL.
2020-07-28Fixed #31829 -- Used JSONField __contains lookup on key transforms.sage
2020-07-28Fixed #31836 -- Dropped support for JSONField __contains and __contained_by ↵Mariusz Felisiak
lookups on SQLite. The current implementation works only for basic examples without supporting nested structures and doesn't follow "the general principle that the contained object must match the containing object as to structure and data contents, possibly after discarding some non-matching array elements or object key/value pairs from the containing object".
2020-07-28Fixed #31835 -- Dropped support for JSONField __contains lookup on Oracle.Mariusz Felisiak
The current implementation works only for basic examples without supporting nested structures and doesn't follow "the general principle that the contained object must match the containing object as to structure and data contents, possibly after discarding some non-matching array elements or object key/value pairs from the containing object".
2020-07-24Fixed #31812 -- Fixed FileField.model for fields defined in abstract models.Matthias Kestenholz
Regression in a93425a37f4defdb31d4ca96bb3bf6da21f0b5ce.
2020-06-17Fixed #30583 -- Fixed handling JSONFields in XML serializer.Hasan Ramezani
Co-authored-by: Chason Chaffin <chason@gmail.com>
2020-06-05Fixed #31663 -- Made DecimalField.to_python() handle non-numeric invalid values.Sasha Pachev
2020-05-18Refs #12990 -- Added DatabaseFeatures.has_json_operators.Tim Graham
CockroachDB also has them.
2020-05-08Fixed #12990, Refs #27694 -- Added JSONField model field.sage
Thanks to Adam Johnson, Carlton Gibson, Mariusz Felisiak, and Raphael Michel for mentoring this Google Summer of Code 2019 project and everyone else who helped with the patch. Special thanks to Mads Jensen, Nick Pope, and Simon Charette for extensive reviews. Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2020-02-04Simplified imports from django.db and django.contrib.gis.db.Nick Pope
2020-01-31Used temporary directory in FileFieldTests.test_pickle().Mariusz Felisiak
Using the current directory caused a PermissionError.
2020-01-31Fixed 31207 -- Prevented references to non-local remote fields in ↵Hasan Ramezani
ForeignKey.to_field. Thanks Simon Charette for the initial patch and review.
2020-01-15Fixed #31124 -- Fixed setting of get_FOO_display() when overriding inherited ↵Carlton Gibson
choices. Regression in 2d38eb0ab9f78d68c083a5b78b1eca39027b279a
2020-01-09Added file cleanup in FileFieldTests.test_pickle().Carlton Gibson
2020-01-09Fixed #21238 -- Fixed restoring attributes when pickling FileField and ↵Hasan Ramezani
ImageField.
2020-01-09Refs #21238 -- Added more tests for pickling FileField and ImageField.Hasan Ramezani
2020-01-09Removed unused lines in ImageFieldTests.test_pickle().Hasan Ramezani
2019-12-27Fixed random models_fields.test_uuid.TestQuerying failures.Mariusz Felisiak
Random failures depended on a generated UUID.
2019-11-19Fixed #30987 -- Added models.PositiveBigIntegerField.Caio Ariede