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(
|
self.assertIn(
|
||||||
"Too many failed login attempts, please retry later.",
|
"Too many failed login attempts.",
|
||||||
resp.data.decode("utf-8"),
|
resp.data.decode("utf-8"),
|
||||||
)
|
)
|
||||||
# Change throttling delay
|
# Try with limiter disabled
|
||||||
from ihatemoney.web import login_throttler
|
from ihatemoney.utils import limiter
|
||||||
|
|
||||||
login_throttler._delay = 0.005
|
try:
|
||||||
# Wait for delay to expire and retry logging in
|
limiter.enabled = False
|
||||||
sleep(1)
|
|
||||||
resp = self.client.post(
|
resp = self.client.post(
|
||||||
"/admin?goto=%2Fcreate", data={"admin_password": "wrong"}
|
"/admin?goto=%2Fcreate", data={"admin_password": "wrong"}
|
||||||
)
|
)
|
||||||
self.assertNotIn(
|
self.assertNotIn(
|
||||||
"Too many failed login attempts, please retry later.",
|
"Too many failed login attempts.",
|
||||||
resp.data.decode("utf-8"),
|
resp.data.decode("utf-8"),
|
||||||
)
|
)
|
||||||
|
finally:
|
||||||
|
limiter.enabled = True
|
||||||
|
|
||||||
def test_manage_bills(self):
|
def test_manage_bills(self):
|
||||||
self.post_project("raclette")
|
self.post_project("raclette")
|
||||||
|
|
Loading…
Reference in a new issue