comparison test/test_liveserver.py @ 8253:cae1bbf2536b

fix: issue2551374 - Add error handling for filter expressions. Fix UI Errors are now reported using the search template. This should work in most situations. However if the query was generated using an alternate search template, the user may not be able to fix it. I'm not sure how to tell what template was used to submit the search. By the time I handle the error, I don't think I have access to an ok template or error template. Might need to add a new field if this becomes a problem. Also fixed a couple of tests changing the status code to 200 from 400 since we aren't on an error page anymore. Updated user_guide including 3 sample error messages for search expressions and how to understand them.
author John Rouillard <rouilj@ieee.org>
date Wed, 01 Jan 2025 02:06:00 -0500
parents f6923d2ba9a5
children 35beff316883
comparison
equal deleted inserted replaced
8252:8a875e0bf749 8253:cae1bbf2536b
378 # print(f.text) 378 # print(f.text)
379 self.assertIn('There was an error searching issue by creator using: ' 379 self.assertIn('There was an error searching issue by creator using: '
380 '[-2]. The operator -2 (not) at position 1 has ' 380 '[-2]. The operator -2 (not) at position 1 has '
381 'too few arguments.', 381 'too few arguments.',
382 f.text) 382 f.text)
383 self.assertEqual(f.status_code, 400) 383 self.assertEqual(f.status_code, 200)
384 384
385 def test_broken_multiink_query(self): 385 def test_broken_multiink_query(self):
386 # query multilink item 386 # query multilink item
387 current_user_query = ( 387 current_user_query = (
388 "@columns=title,id,activity,status,assignedto" 388 "@columns=title,id,activity,status,assignedto"
396 print(f.text) 396 print(f.text)
397 self.assertIn('There was an error searching issue by keyword using: ' 397 self.assertIn('There was an error searching issue by keyword using: '
398 '[-3]. The operator -3 (and) at position 1 has ' 398 '[-3]. The operator -3 (and) at position 1 has '
399 'too few arguments.', 399 'too few arguments.',
400 f.text) 400 f.text)
401 self.assertEqual(f.status_code, 400) 401 self.assertEqual(f.status_code, 200)
402 402
403 def test_start_page(self): 403 def test_start_page(self):
404 """ simple test that verifies that the server can serve a start page. 404 """ simple test that verifies that the server can serve a start page.
405 """ 405 """
406 f = requests.get(self.url_base()) 406 f = requests.get(self.url_base())

Roundup Issue Tracker: http://roundup-tracker.org/