From 8d6f959be226edd9c0eb054a9babe9d4af399717 Mon Sep 17 00:00:00 2001 From: sarahboyce Date: Thu, 16 Mar 2023 06:11:34 +0100 Subject: [PATCH] Refs #1873 -- Added test for IncorrectLookupParameters when list of values is passed to RelatedFieldListFilter. --- tests/admin_filters/tests.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/admin_filters/tests.py b/tests/admin_filters/tests.py index f865f2dd4a..cd71ed8a9f 100644 --- a/tests/admin_filters/tests.py +++ b/tests/admin_filters/tests.py @@ -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)