File tree 2 files changed +12
-0
lines changed
2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -550,6 +550,9 @@ class Term(Query):
550
550
class Terms (Query ):
551
551
name = "terms"
552
552
553
+ def _setattr (self , name : str , value : Any ) -> None :
554
+ super ()._setattr (name , list (value ))
555
+
553
556
554
557
class TermsSet (Query ):
555
558
name = "terms_set"
Original file line number Diff line number Diff line change @@ -77,6 +77,15 @@ def test_term_to_dict() -> None:
77
77
assert {"term" : {"_type" : "article" }} == query .Term (_type = "article" ).to_dict ()
78
78
79
79
80
+ def test_terms_to_dict () -> None :
81
+ assert {"terms" : {"_type" : ["article" , "section" ]}} == query .Terms (
82
+ _type = ["article" , "section" ]
83
+ ).to_dict ()
84
+ assert {"terms" : {"_type" : ["article" , "section" ]}} == query .Terms (
85
+ _type = ("article" , "section" )
86
+ ).to_dict ()
87
+
88
+
80
89
def test_bool_to_dict () -> None :
81
90
bool = query .Bool (must = [query .Match (f = "value" )], should = [])
82
91
You can’t perform that action at this time.
0 commit comments