Mercurial > p > roundup > code
comparison test/test_actions.py @ 5772:8dbe307bdb57
Finish up login rate limit code. Set config item to 0 disables, make
sure config item can't be negative integer.
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Fri, 07 Jun 2019 13:50:57 -0400 |
| parents | 842252c3ee22 |
| children | cbf2f2ea41d1 |
comparison
equal
deleted
inserted
replaced
| 5771:3f00269f3297 | 5772:8dbe307bdb57 |
|---|---|
| 393 | 393 |
| 394 # and make sure we need to wait another three seconds | 394 # and make sure we need to wait another three seconds |
| 395 self.assertRaisesMessage(Reject, LoginAction(self.client).handle, | 395 self.assertRaisesMessage(Reject, LoginAction(self.client).handle, |
| 396 'Logins occurring too fast. Please wait: 3 seconds.') | 396 'Logins occurring too fast. Please wait: 3 seconds.') |
| 397 | 397 |
| 398 def testLoginRateLimitOff(self): | |
| 399 ''' Set number of logins to 0 per minute. Verify that | |
| 400 we can do 1000 which for manual login might as well be off. | |
| 401 ''' | |
| 402 | |
| 403 self.client.db.config.WEB_LOGIN_ATTEMPTS_MIN = 0 | |
| 404 | |
| 405 # Do the first login setting an invalid login name | |
| 406 self.assertLoginLeavesMessages(['Invalid login'], 'nouser') | |
| 407 for i in range(1000): | |
| 408 self.client._error_message = [] | |
| 409 self.assertLoginLeavesMessages(['Invalid login']) | |
| 410 | |
| 398 class EditItemActionTestCase(ActionTestCase): | 411 class EditItemActionTestCase(ActionTestCase): |
| 399 def setUp(self): | 412 def setUp(self): |
| 400 ActionTestCase.setUp(self) | 413 ActionTestCase.setUp(self) |
| 401 self.result = [] | 414 self.result = [] |
| 402 self.new_id = 16 | 415 self.new_id = 16 |
