1
0
mirror of https://github.com/django/django.git synced 2024-12-22 17:16:24 +00:00

Refs #1873 -- Added test for IncorrectLookupParameters when list of values is passed to RelatedFieldListFilter.

This commit is contained in:
sarahboyce 2023-03-16 06:11:34 +01:00 committed by Mariusz Felisiak
parent fc266b694b
commit 8d6f959be2

View File

@ -1167,6 +1167,15 @@ class ListFiltersTests(TestCase):
with self.assertRaises(IncorrectLookupParameters):
modeladmin.get_changelist_instance(request)
def test_fieldlistfilter_multiple_invalid_lookup_parameters(self):
modeladmin = BookAdmin(Book, site)
request = self.request_factory.get(
"/", {"author__id__exact": f"{self.alfred.pk},{self.bob.pk}"}
)
request.user = self.alfred
with self.assertRaises(IncorrectLookupParameters):
modeladmin.get_changelist_instance(request)
def test_simplelistfilter(self):
modeladmin = DecadeFilterBookAdmin(Book, site)