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
1 changed files with 9 additions and 0 deletions

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)