diff options
| author | Andrey Fedoseev <andrey.fedoseev@gmail.com> | 2016-07-11 13:01:43 -0700 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2016-07-12 16:20:06 -0400 |
| commit | 81963b37a92ef583b9f725f1a78dd2ca97c1ab95 (patch) | |
| tree | 3954ee6683c38b2297d83a578d34f34ef22b71ae /tests/model_fields | |
| parent | 1f82b857ceb75f2d7a68e79c6a00c30bfe7f1318 (diff) | |
Fixed #17657 -- Made ModelForm respect ModelMultipleChoiceField's to_field_name.
Follow up to 67d984413c9540074e4fe6aa033081a35cf192bc.
Diffstat (limited to 'tests/model_fields')
| -rw-r--r-- | tests/model_fields/test_manytomanyfield.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/model_fields/test_manytomanyfield.py b/tests/model_fields/test_manytomanyfield.py index 3134a33197..e4f1c0469d 100644 --- a/tests/model_fields/test_manytomanyfield.py +++ b/tests/model_fields/test_manytomanyfield.py @@ -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): """ |
