summaryrefslogtreecommitdiff
path: root/tests/model_fields
AgeCommit message (Collapse)Author
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
2018-04-20Fixed #29247 -- Allowed blank model field choice to be defined in nested ↵orlnub123
choices.
2018-04-20Moved tests for model Field.get_choices().Tim Graham
2018-03-20Fixed #29227 -- Allowed BooleanField to be null=True.Tim Graham
Thanks Lynn Cyrin for contributing to the patch, and Nick Pope for review.
2018-03-16Fixed hanging indentation in various code.Mariusz Felisiak
2017-12-28Fixed #28926 -- Fixed loss of precision of big DurationField values on ↵Sergey Fedoseev
SQLite and MySQL.
2017-12-22Fixed #28937 -- Allowed BinaryField to be editable=True.Cameron Curry
2017-12-12Fixed #28915 -- Prevented SQLite from truncating trailing zeros in the ↵Sergey Fedoseev
fractional part of DecimalField. This reverts commit a146b65628e702a9a3ed5be21542ca45366fbb29 and adds a test for the regression.
2017-11-30Fixed #28856 -- Fixed a regression in caching of a GenericForeignKey ↵Simon Charette
pointing to a MTI model. Regression in b9f8635f58ad743995cad2081b3dc395e55761e5.
2017-11-13Simplified choices iterators in tests.model_fields.models.Sergey Fedoseev