#25723: Related field checks should use their model's apps to lookup related
models
------------------------------------------------+------------------------
Reporter: charettes | Owner: nobody
Type: Bug | Status: new
Component: Core (System checks) | Version: master
Severity: Normal | Keywords:
Triage Stage: Accepted | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
------------------------------------------------+------------------------
Related model fields are using the global apps registry to determine
whether or not their related model is registered (`to`, `through`).
This prevents the creation of checks tests that define model using an
isolated `Apps()` instance.
e.g.
{{{#!python
isolated_apps = Apps()
class Foo(models.Model):
class Meta:
apps = isolated_apps
class Bar(models.Model):
foo = models.ForeignKey(Foo)
class Meta:
apps = isolated_apps
# The following assertion will fail since the `to` check
# will detect a `fields.E300` issue.
asset Bar._meta.get_field('foo').check() == []
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/25723>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/052.8295eb932d6487448c353cf9229fbc7e%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.