django/tests/model_fields
Simon Charette e03e5c751c Fixed #33312 -- Raised explicit exception when copying deferred model instances.
Previously save() would crash with an attempted forced update message, and both
save(force_insert=True) and bulk_create() would crash with DoesNotExist errors
trying to retrieve rows with an empty primary key (id IS NULL).

Implementing deferred field model instance copying might be doable in certain
cases (e.g. when all the deferred fields are db generated) but that's not
trivial to implement in a backward compatible way.

Thanks Adam Sołtysik for the report and test and Clifford for the review.
2025-05-16 08:13:57 +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 Refs #35167 -- Fixed test_bulk_update_custom_get_prep_value() crash on databases that don't support primitives in JSONFields. 2025-02-20 08:14:18 +01:00
storage.py Fixed #35139 -- Prevented file read after ImageField is saved to storage. 2024-05-22 00:25:56 +02:00
test_autofield.py Refs #33476 -- Reformatted code with Black. 2022-02-07 20:37:05 +01:00
test_binaryfield.py Applied Black's 2025 stable style. 2025-03-01 19:41:37 +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 #24561 -- Added support for callables on model fields' choices. 2023-09-14 10:15:33 -03:00
test_datetimefield.py Refs #33476 -- Reformatted code with Black. 2022-02-07 20:37:05 +01:00
test_decimalfield.py Fixed #35982 -- Made DecimalField.get_db_prep_value() call DatabaseOperations.adapt_decimalfield_value(). 2024-12-09 09:46:06 +01: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 Fixed #36005 -- Dropped support for Python 3.10 and 3.11. 2025-01-20 14:07:28 +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_generatedfield.py Fixed #33312 -- Raised explicit exception when copying deferred model instances. 2025-05-16 08:13:57 +02:00
test_genericipaddressfield.py Refs #33476 -- Reformatted code with Black. 2022-02-07 20:37:05 +01:00
test_imagefield.py Fixed #35139 -- Prevented file read after ImageField is saved to storage. 2024-05-22 00:25:56 +02:00
test_integerfield.py Fixed #24561 -- Added support for callables on model fields' choices. 2023-09-14 10:15:33 -03:00
test_jsonfield.py Fixed #36085 -- Added JSONField support for negative array indexing on SQLite. 2025-05-14 13:21:18 +02:00
test_manytomanyfield.py Refs #33476 -- Reformatted code with Black. 2022-02-07 20:37:05 +01:00
test_mixins.py Refs #35405 -- Removed FieldCacheMixin.get_cache_name() per deprecation timeline. 2025-01-15 22:28:37 +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 #35766 -- Handled slices in BaseChoiceIterator. 2024-09-18 16:45:53 +02:00