'Generating choices for ModelChoiceField should require 1 query (#12510).'

def test_choices_not_fetched_when_not_rendering(self):

    self.groups = [Group.objects.create(name=name) for name in 'abc']
    with self.assertNumQueries(1):
        field = ModelChoiceField(Group.objects.order_by('-name'))
        self.assertEqual('a', field.clean(self.groups[0].pk).name)
