# HG changeset patch # User John Rouillard # Date 1714973127 14400 # Node ID 22354d7fc94a79bfc35485ffa2bc389185c2e45f # Parent a9b1365658388afef20fbfdb6d1dd8cd59e7b424 test: issue1525113 - notation to filter by logged-in user Add a test_liveserver test of a @current_user query. Maybe this will catch the templating change somehow?? diff -r a9b136565838 -r 22354d7fc94a test/test_liveserver.py --- a/test/test_liveserver.py Mon May 06 00:49:43 2024 -0400 +++ b/test/test_liveserver.py Mon May 06 01:25:27 2024 -0400 @@ -176,6 +176,37 @@ return session return session, response + + def test_query(self): + current_user_query = ( + "@columns=title,id,activity,status,assignedto&" + "@sort=activity&@group=priority&@filter=creator&" + "@pagesize=50&@startwith=0&creator=%40current_user&" + "@dispname=Test1") + + session, _response = self.create_login_session() + f = session.get(self.url_base()+'/issue?' + current_user_query) + + # verify the query has run by looking for the query name + self.assertIn('List of issues\n - Test1', f.text) + # find title of issue 1 + self.assertIn('foo bar RESULT', f.text) + # match footer "1..1 out of 1" if issue is found + self.assertIn('out of', f.text) + # logout + f = session.get(self.url_base()+'/?@action=logout') + + + # set up for another user + session, _response = self.create_login_session(username="fred") + f = session.get(self.url_base()+'/issue?' + current_user_query) + + # verify the query has run + self.assertIn('List of issues\n - Test1', f.text) + # We should have no rows, so verify the static part + # of the footer is missing. + self.assertNotIn('out of', f.text) + def test_start_page(self): """ simple test that verifies that the server can serve a start page. """