summaryrefslogtreecommitdiff
path: root/tests/model_fields
AgeCommit message (Collapse)Author
2020-09-30[3.1.x] Bumped 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. Backport of e74b3d724e5ddfef96d1d66bd1c58e7aae26fc85 from master
2020-08-28[3.1.x] Fixed #31956 -- Fixed crash of ordering by JSONField with a custom ↵Mariusz Felisiak
decoder on PostgreSQL. Thanks Marc Debureaux for the report. Thanks Simon Charette, Nick Pope, and Adam Johnson for reviews. Backport of 0be51d2226fce030ac9ca840535a524f41e9832c from master
2020-08-26[3.1.x] Fixed #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. Backport of 1251772cb83aa4106f526fe00738e51c0eb59122 from master
2020-07-30[3.1.x] Refs #31829 -- Added ↵Tim Graham
DatabaseFeatures.json_key_contains_list_matching_requires_list. CockroachDB's behavior matches PostgreSQL. Backport of 184a6eebb0ef56d5f1b1315a8e666830e37f3f81 from master
2020-07-28[3.1.x] Fixed #31829 -- Used JSONField __contains lookup on key transforms.sage
Backport of 2d8dcba03aae200aaa103ec1e69f0a0038ec2f85 from master
2020-07-28[3.1.x] Fixed #31836 -- Dropped support for JSONField __contains and ↵Mariusz Felisiak
__contained_by 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". Backport of ba691933cee375195c9c50f333dd4b2a3abbb726 from master.
2020-07-28[3.1.x] Fixed #31835 -- Dropped support for JSONField __contains lookup on ↵Mariusz Felisiak
Oracle. 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". Backport of 02447fb133b53ec7d0ff068cc08f06fdf8817ef7 from master
2020-06-05[3.1.x] Fixed #31663 -- Made DecimalField.to_python() handle non-numeric ↵Sasha Pachev
invalid values. Backport of 38a21f2d9ed4f556af934498ec6a242f6a20418a from master
2020-05-18[3.1.x] Refs #12990 -- Added DatabaseFeatures.has_json_operators.Tim Graham
CockroachDB also has them. Backport of f59a2b730685fc62c5cb44101f54faf8921d9bc7 from master
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
2019-11-07Refs #29983 -- Added support for using pathlib.Path in all settings.Jon Dufresne
2019-11-06Harmonized Windows checks in tests to a single style.Jon Dufresne
2019-11-04Fixed #30931 -- Restored ability to override Model.get_FIELD_display().Carlton Gibson
Thanks Sergey Fedoseev for the implementation idea. Regression in a68ea231012434b522ce45c513d84add516afa60.
2019-10-29Used more specific unittest assertions in tests.Nick Pope
* assertIsNone()/assertIsNotNone() instead of comparing to None. * assertLess() for < comparisons. * assertIs() for 'is' expressions. * assertIsInstance() for isinstance() expressions. * rounding of assertAlmostEqual() for round() expressions. * assertIs(..., True/False) instead of comparing to True/False. * assertIs()/assertIsNot() for ==/!= comparisons. * assertNotEqual() for == comparisons. * assertTrue()/assertFalse() instead of comparing to True/False.
2019-10-23Fixed #29919 -- Fixed RelatedOnlyFieldListFilter crash with reverse ↵Dan Moore
relationships.
2019-10-23Added tests for Field.get_choices()'s limit_choices_to argument.Dan Moore
2019-10-21Replaced deprecated assertEquals() with assertEqual().Jon Dufresne
2019-09-23Fixed #29915 -- Added support for values with hyphens to pattern lookups for ↵Ian Foote
UUIDField on backends without UUID datatype. Support hyphens in iexact, contains, icontains, startswith, istartswith, endswith and iendswith UUIDField filters on backends without UUID datatype.
2019-09-23Refs #29915 -- Added tests for using pattern lookups with values without ↵Ian Foote
hyphens for UUIDField.
2019-09-04Fixed #27910 -- Added enumeration helpers for use in Field.choices.Shai Berger
These classes can serve as a base class for user enums, supporting translatable human-readable names, or names automatically inferred from the enum member name. Additional properties make it easy to access the list of names, values and display labels. Thanks to the following for ideas and reviews: Carlton Gibson, Fran Hrženjak, Ian Foote, Mariusz Felisiak, Shai Berger. Co-authored-by: Shai Berger <shai@platonix.com> Co-authored-by: Nick Pope <nick.pope@flightdataservices.com> Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2019-08-20Fixed #29979, Refs #17337 -- Extracted AutoField field logic into a mixin ↵Nick Pope
and refactored AutoFields. This reduces duplication by allowing AutoField, BigAutoField and SmallAutoField to inherit from IntegerField, BigIntegerField and SmallIntegerField respectively. Doing so also allows for enabling the max_length warning check and minimum/maximum value validation for auto fields, as well as providing a mixin that can be used for other possible future auto field types such as a theoretical UUIDAutoField.
2019-08-15Fixed #30449 -- Fixed RelatedFieldListFilter/RelatedOnlyFieldListFilter to ↵zeyneloz
respect model's Meta.ordering. Regression in 6d4e5feb79f7eabe8a0c7c4b87f25b1a7f87ca0b. Co-Authored-By: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2019-08-05Fixed #28393 -- Added helpful error messages for invalid ↵Diederik van der Boor
AutoField/FloatField/IntegerField values. Co-authored-by: Diederik van der Boor <vdboor@edoburu.nl> Co-authored-by: Nick Pope <nick.pope@flightdataservices.com>
2019-06-28Fixed #30400 -- Improved typography of user facing strings.Jon Dufresne
Thanks Claude Paroz for assistance with translations.
2019-06-07Refs #27804 -- Used subTest() in BinaryFieldTests.test_set_and_retrieve.Jon Dufresne
2019-05-02Fixed #29529 -- Allowed models.fields.FilePathField to accept a callable path.Mykola Kokalko
2019-05-02Added tests for setting models.fields.FilePathField.path.Mykola Kokalko
2019-04-19Fixed #30328 -- Fixed crash of IntegerField.validators when limit_value in a ↵Scott Fitsimones
custom validator is callable.
2019-03-23Removed redundant model field choices tests.Matthias Kestenholz
2019-03-17Refs #12663 -- Fixed reference to nonexistent field in model_fields tests.Simon Charette
2019-03-04Fixed #30232 -- Corrected expected format in invalid DurationField error ↵avas9366
message.
2019-01-30Fixed #30076 -- Added Model.get_FOO_display() even if field's choices are empty.Joshua Cannon
2018-11-27Switched setUp() to setUpTestData() where possible in Django's tests.Simon Charette
2018-11-27Switched TestCase to SimpleTestCase where possible in Django's tests.Tim Graham
2018-11-14Fixed #29835 -- Made RelatedFieldListFilter respect ModelAdmin.ordering.Hasan Ramezani
2018-10-24Fixed #29869 -- Made UUIDField.to_python() convert integers.Sanyam Khurana
2018-10-22Fixed #27595 -- Made ForeignKey.get_col() follow target chains.Simon Charette
Previously, foreign relationships were followed only one level deep which prevents foreign keys to foreign keys from being resolved appropriately. This was causing issues such as improper database value conversion for UUIDField on SQLite because the resolved expression's output field's internal type wasn't correct. Added tests to make sure unlikely foreign reference cycles don't cause recursion errors. Refs #24343. Thanks oyooyo for the report and Wayne Merry for the investigation.
2018-10-01Added tests for using bytearray with BinaryField and corrected docs.Jon Dufresne
2018-09-28Refs #28909 -- Simplifed code using unpacking generalizations.Sergey Fedoseev
2018-09-26Added test of filtering on BinaryField and corrected docs.Jon Dufresne