@@ -155,13 +155,15 @@ def test_15a_tag_search_with_vocab_and_no_matches(self):
155155 def test_15a_tag_search_with_vocab_that_does_not_exist (self ):
156156 paramd = {'q' : 'neo' , 'vocabulary_id' : 'xxxxxx' }
157157 params = json .dumps (paramd )
158- self .app .post ('/api/action/tag_search' , params = params , status = 404 )
158+ res = self .app .post ('/api/action/tag_search' , params = params )
159+ assert json .loads (res .body )['result' ]['results' ]== []
159160
160161 def test_15a_tag_search_with_invalid_vocab (self ):
161162 for vocab_name in (None , '' , 'a' , 'e' * 200 ):
162163 paramd = {'q' : 'neo' , 'vocabulary_id' : vocab_name }
163164 params = json .dumps (paramd )
164- self .app .post ('/api/action/tag_search' , params = params , status = 404 )
165+ res = self .app .post ('/api/action/tag_search' , params = params )
166+ assert json .loads (res .body )['result' ]['results' ] == []
165167
166168 def test_15_tag_autocomplete (self ):
167169 #Empty query
@@ -359,15 +361,15 @@ def test_15_tag_autocomplete_with_vocab_that_does_not_exist(self):
359361 for q in ('' , 'neo' ):
360362 paramd = {'vocabulary_id' : 'does_not_exist' , 'q' : q }
361363 params = json .dumps (paramd )
362- res = self .app .post ('/api/action/tag_autocomplete' , params = params ,
363- status = 404 )
364- assert res .json [ 'success ' ] is False
364+ res = self .app .post ('/api/action/tag_autocomplete' , params = params )
365+ assert res . json [ 'success' ] is True
366+ assert json . loads ( res .body )[ 'result ' ] == []
365367
366368 def test_15_tag_autocomplete_with_invalid_vocab (self ):
367369 for vocab_name in (None , '' , 'a' , 'e' * 200 ):
368370 for q in (None , '' , 'son' ):
369371 paramd = {'vocabulary_id' : vocab_name , 'q' : q }
370372 params = json .dumps (paramd )
371- res = self .app .post ('/api/action/tag_autocomplete' , params = params ,
372- status = 404 )
373- assert res .json [ 'success ' ] is False
373+ res = self .app .post ('/api/action/tag_autocomplete' , params = params )
374+ assert res . json [ 'success' ] is True
375+ assert json . loads ( res .body )[ 'result ' ] == []
0 commit comments