Skip to content

Commit 036ab61

Browse files
committed
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??
1 parent 253a687 commit 036ab61

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

test/test_liveserver.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,37 @@ def create_login_session(self, username="admin", password="sekrit",
176176
return session
177177
return session, response
178178

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)
209+
179210
def test_start_page(self):
180211
""" simple test that verifies that the server can serve a start page.
181212
"""

0 commit comments

Comments
 (0)