comparison test/test_liveserver.py @ 7937:22354d7fc94a

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??
author John Rouillard <rouilj@ieee.org>
date Mon, 06 May 2024 01:25:27 -0400
parents f670446b5e50
children dd229bbdd32d
comparison
equal deleted inserted replaced
7936:a9b136565838 7937:22354d7fc94a
173 session.cookies) 173 session.cookies)
174 174
175 if not return_response: 175 if not return_response:
176 return session 176 return session
177 return session, response 177 return session, response
178
179
180 def test_query(self):
181 current_user_query = (
182 "@columns=title,id,activity,status,assignedto&"
183 "@sort=activity&@group=priority&@filter=creator&"
184 "@pagesize=50&@startwith=0&creator=%40current_user&"
185 "@dispname=Test1")
186
187 session, _response = self.create_login_session()
188 f = session.get(self.url_base()+'/issue?' + current_user_query)
189
190 # verify the query has run by looking for the query name
191 self.assertIn('List of issues\n - Test1', f.text)
192 # find title of issue 1
193 self.assertIn('foo bar RESULT', f.text)
194 # match footer "1..1 out of 1" if issue is found
195 self.assertIn('out of', f.text)
196 # logout
197 f = session.get(self.url_base()+'/?@action=logout')
198
199
200 # set up for another user
201 session, _response = self.create_login_session(username="fred")
202 f = session.get(self.url_base()+'/issue?' + current_user_query)
203
204 # verify the query has run
205 self.assertIn('List of issues\n - Test1', f.text)
206 # We should have no rows, so verify the static part
207 # of the footer is missing.
208 self.assertNotIn('out of', f.text)
178 209
179 def test_start_page(self): 210 def test_start_page(self):
180 """ simple test that verifies that the server can serve a start page. 211 """ simple test that verifies that the server can serve a start page.
181 """ 212 """
182 f = requests.get(self.url_base()) 213 f = requests.get(self.url_base())

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