django/tests/model_fields
François Freitag bcacc6321a Refs #34517 -- Restored skipping ImageFileField.update_dimension_fields without width/height fields.
This avoids reading the image size when the dimensions fields
(image_width, image_height) do not exist, as that operation may be
expensive.

Partially reverts ea53e7c09f, that dropped
the check for the dimension fields in update_dimension_fields(), because
the post_init signal was no longer registered without dimension fields.

However, another code path to that function exists: when the
ImageFileField is save()d, the name from the storage is setattr()ed on
the field, and ImageFileDescriptor calls update_dimension_fields()
because the image size might have changed. Keep bailing out early when
dimensions are unused.

Besides, computing the image dimensions causes to close() the file,
resulting in a backward-incompatible change. The test protects against
that change.
2023-06-19 05:24:42 +02:00
..
4x8.png Merged regressiontests and modeltests into the test root. 2013-02-26 14:36:57 +01:00
8x4.png Merged regressiontests and modeltests into the test root. 2013-02-26 14:36:57 +01:00
__init__.py Merged regressiontests and modeltests into the test root. 2013-02-26 14:36:57 +01:00
models.py Fixed #34388 -- Allowed using choice enumeration types directly on model and form fields. 2023-03-21 19:44:41 +01:00
test_autofield.py Refs #33476 -- Reformatted code with Black. 2022-02-07 20:37:05 +01:00
test_binaryfield.py Refs #33476 -- Reformatted code with Black. 2022-02-07 20:37:05 +01:00
test_booleanfield.py Removed obsolete assertions in BooleanFieldTests.test_return_type(). 2022-06-03 21:28:46 +02:00
test_charfield.py Fixed #34388 -- Allowed using choice enumeration types directly on model and form fields. 2023-03-21 19:44:41 +01:00
test_datetimefield.py Refs #33476 -- Reformatted code with Black. 2022-02-07 20:37:05 +01:00
test_decimalfield.py Fixed #34590 -- Reverted "Refs #33308 -- Improved adapting DecimalField values to decimal." 2023-05-24 10:59:55 +02:00
test_durationfield.py Relaxed some query ordering assertions in various tests. 2022-04-14 12:12:13 +02:00
test_field_flags.py Refs #33476 -- Reformatted code with Black. 2022-02-07 20:37:05 +01:00
test_filefield.py Refs #34100 -- Made file upload tests use Storage.exists() where appropriate. 2022-12-30 13:28:47 +01:00
test_filepathfield.py Fixed #29529 -- Allowed models.fields.FilePathField to accept a callable path. 2019-05-02 11:11:56 +02:00
test_floatfield.py Refs #33476 -- Reformatted code with Black. 2022-02-07 20:37:05 +01:00
test_foreignkey.py Refs #31223 -- Added __class_getitem__() to ForeignKey. 2022-04-22 14:13:12 +02:00
test_genericipaddressfield.py Refs #33476 -- Reformatted code with Black. 2022-02-07 20:37:05 +01:00
test_imagefield.py Refs #34517 -- Restored skipping ImageFileField.update_dimension_fields without width/height fields. 2023-06-19 05:24:42 +02:00
test_integerfield.py Fixed #34388 -- Allowed using choice enumeration types directly on model and form fields. 2023-03-21 19:44:41 +01:00
test_jsonfield.py Fixed #34539 -- Restored get_prep_value() call when adapting JSONFields. 2023-05-16 08:26:41 +02:00
test_manytomanyfield.py Refs #33476 -- Reformatted code with Black. 2022-02-07 20:37:05 +01:00
test_promises.py Refs #33476 -- Reformatted code with Black. 2022-02-07 20:37:05 +01:00
test_slugfield.py Refs #33476 -- Reformatted code with Black. 2022-02-07 20:37:05 +01:00
test_textfield.py Refs #33476 -- Reformatted code with Black. 2022-02-07 20:37:05 +01:00
test_uuid.py Refs #33476 -- Reformatted code with Black. 2022-02-07 20:37:05 +01:00
tests.py Fixed #34388 -- Allowed using choice enumeration types directly on model and form fields. 2023-03-21 19:44:41 +01:00