1
0
mirror of https://github.com/django/django.git synced 2024-12-22 09:05:43 +00:00
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
..
__init__.py
4x8.png
8x4.png
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
test_binaryfield.py
test_booleanfield.py
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
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
test_field_flags.py
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
test_floatfield.py
test_foreignkey.py
test_genericipaddressfield.py
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
test_promises.py
test_slugfield.py
test_textfield.py
test_uuid.py
tests.py Fixed #34388 -- Allowed using choice enumeration types directly on model and form fields. 2023-03-21 19:44:41 +01:00