@@ -83,7 +83,7 @@ def test_if_absolutePath_is_invalid_and_is_not_a_objectbrowser_call_do_not_filte
8383 self .assertEqual (response .status_code , 200 )
8484 self .assertEqual (result ["items_total" ], 2 )
8585
86- def test_search_event_no_event_search (self ):
86+ def test_search_event_no_event_search_lessthan (self ):
8787 start_date = datetime .strptime ("1/11/2024 10:00:00" , "%d/%m/%Y %H:%M:%S" )
8888 end_date = start_date + timedelta (days = 1 , hours = 1 )
8989 createContentInContainer (
@@ -139,6 +139,62 @@ def test_search_event_no_event_search(self):
139139 self .assertEqual (response .status_code , 200 )
140140 self .assertEqual (result ["items_total" ], 0 )
141141
142+ def test_search_event_no_event_search_largerthan (self ):
143+ start_date = datetime .strptime ("1/11/2024 10:00:00" , "%d/%m/%Y %H:%M:%S" )
144+ end_date = start_date + timedelta (days = 1 , hours = 1 )
145+ createContentInContainer (
146+ self .portal ,
147+ "Event" ,
148+ id = "test-event" ,
149+ title = "Test Event" ,
150+ start = start_date ,
151+ end = end_date ,
152+ location = "Vienna" ,
153+ )
154+ commit ()
155+
156+ response = self .api_session .post (
157+ "/@querystring-search" ,
158+ json = {
159+ "query" : [
160+ {
161+ "i" : "portal_type" ,
162+ "o" : "plone.app.querystring.operation.selection.any" ,
163+ "v" : ["Event" ],
164+ },
165+ {
166+ "i" : "start" ,
167+ "o" : "plone.app.querystring.operation.date.largerThan" ,
168+ "v" : "2024-11-02" ,
169+ },
170+ ],
171+ },
172+ )
173+ result = response .json ()
174+ self .assertEqual (response .status_code , 200 )
175+ self .assertEqual (result ["items_total" ], 0 )
176+
177+ response = self .api_session .post (
178+ "/@querystring-search" ,
179+ json = {
180+ "query" : [
181+ {
182+ "i" : "portal_type" ,
183+ "o" : "plone.app.querystring.operation.selection.any" ,
184+ "v" : ["Event" ],
185+ },
186+ {
187+ "i" : "start" ,
188+ "o" : "plone.app.querystring.operation.date.largerThan" ,
189+ "v" : "2024-10-29" ,
190+ },
191+ ],
192+ },
193+ )
194+ result = response .json ()
195+ self .assertEqual (response .status_code , 200 )
196+ self .assertEqual (result ["items_total" ], 1 )
197+
142198 def test_search_event_event_search (self ):
143199 # TODO
144200 # {"metadata_fields":"_all","b_size":24,"limit":"9","query":[{"i":"portal_type","o":"plone.app.querystring.operation.selection.any","v":["Event"]},{"i":"path","o":"plone.app.querystring.operation.string.relativePath","v":"novita/eventi"},{"i":"start","o":"plone.app.querystring.operation.date.today","v":""}],"sort_on":"start","sort_order":"descending","b_start":0}
0 commit comments