| 1 |
from http import HTTPStatus |
| 2 |
|
| 3 |
from django.urls import reverse |
| 4 |
|
| 5 |
|
| 6 |
def test_case_insensitive_password_reset(settings, enable_cache, user_factory, client): |
| 7 |
settings.ACCOUNT_RATE_LIMITS = {"reset_password": "1/m"} |
| 8 |
user_factory(email="[email protected]") |
| 9 |
resp = client.post(reverse("account_reset_password"), data={"email": "[email protected]"}) |
| 10 |
assert resp.status_code == HTTPStatus.FOUND |
| 11 |
resp = client.post(reverse("account_reset_password"), data={"email": "[email protected]"}) |
| 12 |
assert resp.status_code == HTTPStatus.TOO_MANY_REQUESTS |