Fixed test_clean_does_deduplicate_values on Oracle after e13cfc6dfd.

This commit is contained in:
Mariusz Felisiak 2020-06-26 22:37:58 +02:00 committed by GitHub
parent 8984cab8a8
commit 09914ccf68
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions

View File

@ -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)