change method to find login_throttler

that was triggering a lot of deprecation warnings due to
iterating over all known objects.
This commit is contained in:
Glandos 2021-06-09 23:56:16 +02:00
parent 69a1ad6685
commit 44fa1af375

View file

@ -494,12 +494,9 @@ class BudgetTestCase(IhatemoneyTestCase):
resp.data.decode("utf-8"), resp.data.decode("utf-8"),
) )
# Change throttling delay # Change throttling delay
import gc from ihatemoney.web import login_throttler
for obj in gc.get_objects(): login_throttler._delay = 0.005
if isinstance(obj, utils.LoginThrottler):
obj._delay = 0.005
break
# Wait for delay to expire and retry logging in # Wait for delay to expire and retry logging in
sleep(1) sleep(1)
resp = self.client.post( resp = self.client.post(