diff --git a/tests/model_forms/tests.py b/tests/model_forms/tests.py index 42ea63dd4d..914defe5e7 100644 --- a/tests/model_forms/tests.py +++ b/tests/model_forms/tests.py @@ -1863,11 +1863,11 @@ class ModelMultipleChoiceFieldTests(TestCase): self.assertTrue(form.has_changed()) def test_clean_does_deduplicate_values(self): - class WriterForm(forms.Form): - persons = forms.ModelMultipleChoiceField(queryset=Writer.objects.all()) + class PersonForm(forms.Form): + persons = forms.ModelMultipleChoiceField(queryset=Person.objects.all()) - person1 = Writer.objects.create(name="Person 1") - form = WriterForm(data={}) + person1 = Person.objects.create(name='Person 1') + form = PersonForm(data={}) queryset = form.fields['persons'].clean([str(person1.pk)] * 50) sql, params = queryset.query.sql_with_params() self.assertEqual(len(params), 1)