File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -170,14 +170,15 @@ class LookupFilterBackend(BaseFilterBackend):
170170 "isnull" ,
171171 },
172172 models .CharField : {
173+ "iexact" ,
173174 "ne" ,
174175 "startswith" ,
175176 "istartswith" ,
176177 "endswith" ,
177- "icontains " ,
178+ "iendswith " ,
178179 "contains" ,
180+ "icontains" ,
179181 "in" ,
180- "iendswith" ,
181182 "isnull" ,
182183 "regex" ,
183184 "iregex" ,
Original file line number Diff line number Diff line change @@ -915,6 +915,14 @@ def test_filter_by_hostname(self):
915915 self .assertEqual (response .status_code , status .HTTP_200_OK )
916916 self .assertEqual (response .data ["count" ], 1 )
917917
918+ def test_filter_by_hostname_case_insensitive (self ):
919+ url = "{}?{}" .format (
920+ reverse ("dchost-list" ), urlencode ({"hostname__iexact" : "AAAA" })
921+ )
922+ response = self .client .get (url , format = "json" )
923+ self .assertEqual (response .status_code , status .HTTP_200_OK )
924+ self .assertEqual (response .data ["count" ], 1 )
925+
918926 def test_filter_by_name (self ):
919927 url = "{}?{}" .format (reverse ("dchost-list" ), urlencode ({"name" : "aaaa" }))
920928 response = self .client .get (url , format = "json" )
You can’t perform that action at this time.
0 commit comments