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

[1.10.x] Fixed #17657 -- Made ModelForm respect ModelMultipleChoiceField's to_field_name.

Follow up to 67d984413c.

Backport of 81963b37a9 from master
This commit is contained in:
Andrey Fedoseev
2016-07-11 13:01:43 -07:00
committed by Tim Graham
parent 5d8332aaee
commit ded5020241
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):
"""