summaryrefslogtreecommitdiff
path: root/tests/invalid_models_tests
AgeCommit message (Collapse)Author
2026-04-02Fixed #36973 -- Made fields.E348 check detect further clashes between ↵Clifford Gama
managers and related_names. Clashes were only detected for self-referential relationships, i.e. ForeignKey("self"). Refs #22977. Bug in 6888375c53476011754f778deabc6cdbfa327011. Thanks JaeHyuckSa for the thorough review!
2025-12-28Refs #24920 -- Made DecimalField system checks database dependent.Mariusz Felisiak
Thanks Tim Graham for the suggestion.
2025-12-22Fixed #36806 -- Added system check for null kwarg in GeneratedField.Nilesh Kumar Pahari
The null argument has no effect on GeneratedField since the nullability of the column depends on the database and expression used.
2025-12-16Fixed #36594 -- Improved UniqueConstraint's nulls_distinct system check message.Mridul Dhall
Clarified that the nulls_distinct argument is not supported, as opposed to certain values for the argument. Thanks Russell Owen for the report.
2025-11-23Refs #21961 -- Added DatabaseFeatures.supports_on_delete_db_(cascade/null) ↵Tim Graham
feature flags. Needed on MongoDB. Co-Authored-By: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2025-11-19Fixed #26609 -- Extended fields.E004 system check for unordered iterables.Mariusz Felisiak
Co-authored-by: Karl Wooster <karl.wooster@alleima.com>
2025-11-17Fixed #24920 -- Added support for DecimalField with no precision.Mariusz Felisiak
Thanks Lily for the review.
2025-10-18Fixed #21961 -- Added support for database-level delete options for ForeignKey.Mariusz Felisiak
Thanks Simon Charette for pair programming. Co-authored-by: Nick Stefan <NickStefan12@gmail.com> Co-authored-by: Akash Kumar Sen <71623442+Akash-Kumar-Sen@users.noreply.github.com> Co-authored-by: Simon Charette <charette.s@gmail.com>
2025-10-13Fixed #36611, Refs #36580 -- Added system check for multicolumn ↵Sarah Boyce
ForeignObject in Meta.indexes/constraints/unique_together. ForeignObjects with multiple `from_fields` are not supported in these options. Co-authored-by: Jacob Walls <jacobtylerwalls@gmail.com> Co-authored-by: Natalia <124304+nessita@users.noreply.github.com>
2025-10-13Fixed #36660 -- Fixed a regression in descending Index local field checks.Simon Charette
Regression in 8638d8bf74c1a58302c97d4436ad2eb08438145b. Refs #36273. Thanks Federico Bond for the report.
2025-08-05Fixed #36530 -- Extended fields.E347 to check for ManyToManyField involving ↵jkhall81
CompositePrimaryKey on either side. Thanks to Jacob Walls for the report.
2025-06-18Fixed #32770 -- Added system check to ensure django.contrib.postgres is ↵Clifford Gama
installed when using its features. Added postgres.E005 to validate 'django.contrib.postgres' is in INSTALLED_APPS when using: * PostgreSQL-specific fields (ArrayField, HStoreField, range fields, SearchVectorField), * PostgreSQL indexes (PostgresIndex and all subclasses), and * ExclusionConstraint The check provides immediate feedback during system checks rather than failing later with obscure runtime and database errors. Thanks to Simon Charette and Sarah Boyce for reviews.
2025-05-14Fixed #36273 -- Moved Index system checks from Model to Index.check().Tim Graham
2025-03-31Fixed #22977 -- Added system check for clashing managers and reverse related ↵Anthony Joseph
fields. With thanks to Konrad Świat, Loïc Bistuer, Russell Keith-Magee, and Mariusz Felisiak. Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2025-03-28Fixed #36239 -- Fixed a crash in ManyToManyField.through_fields check when ↵saJaeHyukc
to model is invalid. Signed-off-by: saJaeHyukc <wogur981208@gmail.com>
2025-01-02Fixed #36034 -- Added system check for ↵Mariusz Felisiak
ForeignKey/ForeignObject/ManyToManyField to CompositePrimaryKeys.
2024-12-17Fixed #35992, Fixed #35997 -- Added system check for CompositePrimaryKeys in ↵Mariusz Felisiak
Meta.indexes/constraints/unique_together. CompositePrimaryKeys are not supported in any of these options.
2024-11-11Fixed #35815 -- Made system check accept db_default literals when ↵Tim Graham
DatabaseFeatures.supports_expression_defaults = False.
2024-07-09Fixed #35580 -- Allowed related fields referencing auto-created through models.jason_bruce
2024-03-17Fixed #35301 -- Fixed Options._property_names for overriden properties.Adam Johnson
Regression in faeb92ea13f0c1b2cc83f45b512f2c41cfb4f02d.
2024-03-01Refs #35234 -- Deprecated CheckConstraint.check in favor of .condition.Simon Charette
Once the deprecation period ends CheckConstraint.check() can become the documented method that performs system checks for BaseConstraint subclasses.
2024-02-21Refs #30913 -- Corrected IndexesTests.test_index_include_pointing_to_fk().Simon Charette
This adjusts a test assigning an Index to Meta.constraints.
2024-01-26Applied Black's 2024 stable style.Mariusz Felisiak
https://github.com/psf/black/releases/tag/24.1.0
2023-11-14Refs #34944 -- Propagated system checks for GeneratedField.output_field.Mariusz Felisiak
2023-11-14Fixed #34944 -- Made GeneratedField.output_field required.Mariusz Felisiak
Regression in f333e3513e8bdf5ffeb6eeb63021c230082e6f95.
2023-09-18Refs #33872 -- Removed ↵Mariusz Felisiak
django.contrib.postgres.fields.CIText/CICharField/CIEmailField/CITextField. Per deprecation timeline.
2023-09-18Refs #27236 -- Removed Meta.index_together per deprecation timeline.Mariusz Felisiak
2023-09-14Fixed #24561 -- Added support for callables on model fields' choices.Natalia
2023-09-07Fixed #31300 -- Added GeneratedField model field.Jeremy Nauta
Thanks Adam Johnson and Paolo Melchiorre for reviews. Co-Authored-By: Lily Foote <code@lilyf.org> Co-Authored-By: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2023-08-30 Fixed #31262 -- Added support for mappings on model fields and ↵Nick Pope
ChoiceField's choices.
2023-08-08Added IntegerField tests for checks for invalid choices.Nick Pope
2023-07-19Fixed #34701 -- Added support for NULLS [NOT] DISTINCT on PostgreSQL 15+.Simon Charette
2023-06-20Fixed #34634 -- Adjusted system check for clashing fields to warn about ↵Akash Kumar Sen
links to common parent for MTI models.
2023-05-12Fixed #470 -- Added support for database defaults on fields.Ian Foote
Special thanks to Hannes Ljungberg for finding multiple implementation gaps. Thanks also to Simon Charette, Adam Johnson, and Mariusz Felisiak for reviews.
2023-05-02Refs #31369 -- Improved hint message in NullBooleanField's deprecation warning.Paul Brown
2023-02-01Refs #33476 -- Applied Black's 2023 stable style.David Smith
Black 23.1.0 is released which, as the first release of the year, introduces the 2023 stable style. This incorporates most of last year's preview style. https://github.com/psf/black/releases/tag/23.1.0
2022-12-28Fixed #14094 -- Added support for unlimited CharField on PostgreSQL.Adrian Torres
Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2022-12-28Fixed #18468 -- Added support for comments on columns and tables.kimsoungryoul
Thanks Jared Chung, Tom Carrick, David Smith, Nick Pope, and Mariusz Felisiak for reviews. Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com> Co-authored-by: Nick Pope <nick@nickpope.me.uk>
2022-08-03Fixed #33872 -- Deprecated ↵Mariusz Felisiak
django.contrib.postgres.fields.CIText/CICharField/CIEmailField/CITextField.
2022-07-12Fixed #27236 -- Deprecated Meta.index_together in favor of Meta.indexes.David Wobrock
This also deprecates AlterIndexTogether migration operation.
2022-05-10Fixed #30581 -- Added support for Meta.constraints validation.Gagaro
Thanks Simon Charette, Keryn Knight, and Mariusz Felisiak for reviews.
2022-02-07Refs #33476 -- Refactored code to strictly match 88 characters line length.Mariusz Felisiak
2022-02-07Refs #33476 -- Reformatted code with Black.django-bot
2022-02-03Refs #33476 -- Refactored problematic code before reformatting by Black.Mariusz Felisiak
In these cases Black produces unexpected results, e.g. def make_random_password( self, length=10, allowed_chars='abcdefghjkmnpqrstuvwxyz' 'ABCDEFGHJKLMNPQRSTUVWXYZ' '23456789', ): or cursor.execute(""" SELECT ... """, [table name], )
2021-10-06Fixed #33131 -- Improved error messages for clashing reverse accessor names.Bernd Wechner
2021-09-09Fixed #33084 -- Removed incorrect system check for ManyToManyField with ↵Hasan Ramezani
limit_choices_to.
2021-08-06Fixed #32983 -- Added system check for redundant related_name on symmetrical ↵Nick Touran
M2M fields. Since ManyToManyFields defined with `symmetrical=True` do not add a related field to the target model, including a `related_name` argument will never do what the coder likely expects. This makes including a related_name with a symmetrical model raise a system check warning. ticket-32983
2021-07-30Fixed #32966 -- Fixed TimeField.check() crash for timezone-aware times in ↵Chris Jerdonek
default when USE_TZ = True.
2021-07-26Fixed #32947 -- Fixed hash() crash on reverse M2M relation when ↵Tom Wojcik
through_fields is a list. Regression in c32d8f33d8e988a376e44997b8f3606d821f305e.
2021-07-15Refs #32508 -- Raised Type/ValueError instead of using "assert" in ↵Daniyal
django.db.models. Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>