mirror of
https://github.com/django/django.git
synced 2025-10-24 14:16:09 +00:00
Fixed #27563 -- Moved "apply limit_choices_to" code from BaseModelForm to fields_for_model().
This commit is contained in:
@@ -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):
|
||||
|
||||
|
||||
Reference in New Issue
Block a user