Mercurial > p > roundup > code
comparison test/test_actions.py @ 6468:37b57da3374f
issue2550917 - Add a: "Welcome user, you have logged in" ok_message on login.
| author | aburke |
|---|---|
| date | Fri, 20 Aug 2021 23:56:24 -0400 |
| parents | f2c31f5ec50b |
| children | 8269e89530e5 |
comparison
equal
deleted
inserted
replaced
| 6467:679ec82798e9 | 6468:37b57da3374f |
|---|---|
| 366 def opendb(username): | 366 def opendb(username): |
| 367 self.assertEqual(username, 'foo') | 367 self.assertEqual(username, 'foo') |
| 368 self.client.opendb = opendb | 368 self.client.opendb = opendb |
| 369 | 369 |
| 370 # basic test with query | 370 # basic test with query |
| 371 self.assertLoginRaisesRedirect("http://whoami.com/path/issue?%40action=search", | 371 self.assertLoginRaisesRedirect("http://whoami.com/path/issue?%40action=search&%40ok_message=Welcome+foo%21", |
| 372 'foo', 'right', "http://whoami.com/path/issue?@action=search") | 372 'foo', 'right', "http://whoami.com/path/issue?@action=search") |
| 373 | 373 |
| 374 # test that old messages are removed | 374 # test that old messages are removed |
| 375 self.form.value[:] = [] # clear out last test's setup values | 375 self.form.value[:] = [] # clear out last test's setup values |
| 376 self.assertLoginRaisesRedirect("http://whoami.com/path/issue?%40action=search", | 376 self.assertLoginRaisesRedirect("http://whoami.com/path/issue?%40action=search&%40ok_message=Welcome+foo%21", |
| 377 'foo', 'right', "http://whoami.com/path/issue?@action=search&@ok_messagehurrah+we+win&@error_message=blam") | 377 'foo', 'right', "http://whoami.com/path/issue?@action=search&@ok_messagehurrah+we+win&@error_message=blam") |
| 378 | 378 |
| 379 # test when there is no query | 379 # test when there is no query |
| 380 self.form.value[:] = [] # clear out last test's setup values | 380 self.form.value[:] = [] # clear out last test's setup values |
| 381 self.assertLoginRaisesRedirect("http://whoami.com/path/issue255", | 381 self.assertLoginRaisesRedirect("http://whoami.com/path/issue255?%40ok_message=Welcome+foo%21", |
| 382 'foo', 'right', "http://whoami.com/path/issue255") | 382 'foo', 'right', "http://whoami.com/path/issue255") |
| 383 | 383 |
| 384 # test if we are logged out; should kill the @action=logout | 384 # test if we are logged out; should kill the @action=logout |
| 385 self.form.value[:] = [] # clear out last test's setup values | 385 self.form.value[:] = [] # clear out last test's setup values |
| 386 self.assertLoginRaisesRedirect("http://whoami.com/path/issue39?%40pagesize=50&%40startwith=0", | 386 self.assertLoginRaisesRedirect("http://whoami.com/path/issue39?%40ok_message=Welcome+foo%21&%40pagesize=50&%40startwith=0", |
| 387 'foo', 'right', "http://whoami.com/path/issue39?@action=logout&@pagesize=50&@startwith=0") | 387 'foo', 'right', "http://whoami.com/path/issue39?@action=logout&@pagesize=50&@startwith=0") |
| 388 | 388 |
| 389 def testInvalidLoginRedirect(self): | 389 def testInvalidLoginRedirect(self): |
| 390 self.client.db.security.hasPermission = lambda *args, **kwargs: True | 390 self.client.db.security.hasPermission = lambda *args, **kwargs: True |
| 391 | 391 |
