mirror of
https://github.com/spiral-project/ihatemoney.git
synced 2025-04-28 17:32:38 +02:00
fix tests
This commit is contained in:
parent
d834394a44
commit
4d7e966f7f
1 changed files with 14 additions and 13 deletions
|
@ -601,22 +601,23 @@ class BudgetTestCase(IhatemoneyTestCase):
|
|||
)
|
||||
|
||||
self.assertIn(
|
||||
"Too many failed login attempts, please retry later.",
|
||||
"Too many failed login attempts.",
|
||||
resp.data.decode("utf-8"),
|
||||
)
|
||||
# Change throttling delay
|
||||
from ihatemoney.web import login_throttler
|
||||
# Try with limiter disabled
|
||||
from ihatemoney.utils import limiter
|
||||
|
||||
login_throttler._delay = 0.005
|
||||
# Wait for delay to expire and retry logging in
|
||||
sleep(1)
|
||||
try:
|
||||
limiter.enabled = False
|
||||
resp = self.client.post(
|
||||
"/admin?goto=%2Fcreate", data={"admin_password": "wrong"}
|
||||
)
|
||||
self.assertNotIn(
|
||||
"Too many failed login attempts, please retry later.",
|
||||
"Too many failed login attempts.",
|
||||
resp.data.decode("utf-8"),
|
||||
)
|
||||
finally:
|
||||
limiter.enabled = True
|
||||
|
||||
def test_manage_bills(self):
|
||||
self.post_project("raclette")
|
||||
|
|
Loading…
Reference in a new issue