diff options
| author | Jon Dufresne <jon.dufresne@gmail.com> | 2016-12-01 18:28:29 -0800 |
|---|---|---|
| committer | Jon Dufresne <jon.dufresne@gmail.com> | 2016-12-02 08:40:24 -0800 |
| commit | 6abd6c598ea23e0a962c87b0075aa2f79f9ead36 (patch) | |
| tree | ba0ef77b7887f14cb9a93f7bb1b86685fa6271da /tests/model_forms | |
| parent | 6d1394182d8c4c02598e0cf47f42a5e86706411f (diff) | |
Fixed #27563 -- Moved "apply limit_choices_to" code from BaseModelForm to fields_for_model().
Diffstat (limited to 'tests/model_forms')
| -rw-r--r-- | tests/model_forms/tests.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/model_forms/tests.py b/tests/model_forms/tests.py index d1c5b00d8a..f4216ca51b 100644 --- a/tests/model_forms/tests.py +++ b/tests/model_forms/tests.py @@ -2854,6 +2854,10 @@ class LimitChoicesToTest(TestCase): f = StumpJokeWithCustomFieldForm() self.assertEqual(f.fields['custom'].queryset, 42) + def test_fields_for_model_applies_limit_choices_to(self): + fields = fields_for_model(StumpJoke, ['has_fooled_today']) + self.assertSequenceEqual(fields['has_fooled_today'].queryset, [self.threepwood]) + class FormFieldCallbackTests(SimpleTestCase): |
