Mercurial > p > roundup > code
comparison test/test_actions.py @ 5503:4f6e1ce89557
always encode query parameters in sorted order
| author | Christof Meerwald <cmeerw@cmeerw.org> |
|---|---|
| date | Thu, 16 Aug 2018 20:14:09 +0100 |
| parents | d26921b851c3 |
| children | 2ce41b8dffaf |
comparison
equal
deleted
inserted
replaced
| 5502:497ab896397d | 5503:4f6e1ce89557 |
|---|---|
| 323 self.assertLoginRaisesRedirect("http://whoami.com/path/issue255", | 323 self.assertLoginRaisesRedirect("http://whoami.com/path/issue255", |
| 324 'foo', 'right', "http://whoami.com/path/issue255") | 324 'foo', 'right', "http://whoami.com/path/issue255") |
| 325 | 325 |
| 326 # test if we are logged out; should kill the @action=logout | 326 # test if we are logged out; should kill the @action=logout |
| 327 self.form.value[:] = [] # clear out last test's setup values | 327 self.form.value[:] = [] # clear out last test's setup values |
| 328 self.assertLoginRaisesRedirect("http://whoami.com/path/issue39?%40startwith=0&%40pagesize=50", | 328 self.assertLoginRaisesRedirect("http://whoami.com/path/issue39?%40pagesize=50&%40startwith=0", |
| 329 'foo', 'right', "http://whoami.com/path/issue39?@action=logout&@pagesize=50&@startwith=0") | 329 'foo', 'right', "http://whoami.com/path/issue39?@action=logout&@pagesize=50&@startwith=0") |
| 330 | 330 |
| 331 def testInvalidLoginRedirect(self): | 331 def testInvalidLoginRedirect(self): |
| 332 self.client.db.security.hasPermission = lambda *args, **kwargs: True | 332 self.client.db.security.hasPermission = lambda *args, **kwargs: True |
| 333 | 333 |
| 334 def opendb(username): | 334 def opendb(username): |
| 335 self.assertEqual(username, 'foo') | 335 self.assertEqual(username, 'foo') |
| 336 self.client.opendb = opendb | 336 self.client.opendb = opendb |
| 337 | 337 |
| 338 # basic test with query | 338 # basic test with query |
| 339 self.assertLoginRaisesRedirect("http://whoami.com/path/issue?%40error_message=Invalid+login&%40action=search", | 339 self.assertLoginRaisesRedirect("http://whoami.com/path/issue?%40action=search&%40error_message=Invalid+login", |
| 340 'foo', 'wrong', "http://whoami.com/path/issue?@action=search") | 340 'foo', 'wrong', "http://whoami.com/path/issue?@action=search") |
| 341 | 341 |
| 342 # test that old messages are removed | 342 # test that old messages are removed |
| 343 self.form.value[:] = [] # clear out last test's setup values | 343 self.form.value[:] = [] # clear out last test's setup values |
| 344 self.assertLoginRaisesRedirect("http://whoami.com/path/issue?%40error_message=Invalid+login&%40action=search", | 344 self.assertLoginRaisesRedirect("http://whoami.com/path/issue?%40action=search&%40error_message=Invalid+login", |
| 345 'foo', 'wrong', "http://whoami.com/path/issue?@action=search&@ok_messagehurrah+we+win&@error_message=blam") | 345 'foo', 'wrong', "http://whoami.com/path/issue?@action=search&@ok_messagehurrah+we+win&@error_message=blam") |
| 346 | 346 |
| 347 # test when there is no __came_from specified | 347 # test when there is no __came_from specified |
| 348 self.form.value[:] = [] # clear out last test's setup values | 348 self.form.value[:] = [] # clear out last test's setup values |
| 349 # I am not sure why this produces three copies of the same error. | 349 # I am not sure why this produces three copies of the same error. |
