mirror of
https://github.com/django/django.git
synced 2025-08-03 18:38:50 +00:00
Fixed #25292 -- Fixed crash in ManyToManyField.through_fields check.
This commit is contained in:
parent
490107f14d
commit
baff4dd37d
2 changed files with 20 additions and 0 deletions
|
@ -307,6 +307,22 @@ class RelativeFieldTests(SimpleTestCase):
|
|||
]
|
||||
self.assertEqual(errors, expected)
|
||||
|
||||
def test_missing_relationship_model_on_model_check(self):
|
||||
class Person(models.Model):
|
||||
pass
|
||||
|
||||
class Group(models.Model):
|
||||
members = models.ManyToManyField('Person', through='MissingM2MModel')
|
||||
|
||||
self.assertEqual(Group.check(), [
|
||||
Error(
|
||||
"Field specifies a many-to-many relation through model "
|
||||
"'MissingM2MModel', which has not been installed.",
|
||||
obj=Group._meta.get_field('members'),
|
||||
id='fields.E331',
|
||||
),
|
||||
])
|
||||
|
||||
@isolate_apps('invalid_models_tests')
|
||||
def test_many_to_many_through_isolate_apps_model(self):
|
||||
"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue