1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Fixed #17657 -- Made ModelForm respect ModelMultipleChoiceField's to_field_name.

Follow up to 67d984413c.
This commit is contained in:
Andrey Fedoseev
2016-07-11 13:01:43 -07:00
committed by Tim Graham
parent 1f82b857ce
commit 81963b37a9
3 changed files with 24 additions and 78 deletions

View File

@@ -12,7 +12,9 @@ class ManyToManyFieldTests(SimpleTestCase):
m2m = models.ManyToManyField('self', models.CASCADE)
instance = ManyToManyModel()
self.assertEqual(instance._meta.get_field('m2m').value_from_object(instance), [])
qs = instance._meta.get_field('m2m').value_from_object(instance)
self.assertEqual(qs.model, ManyToManyModel)
self.assertEqual(list(qs), [])
def test_abstract_model_pending_operations(self):
"""