Skip to content

Commit

Permalink
Ensuring password-reset test is more deterministic by clearing cache …
Browse files Browse the repository at this point in the history
…before performing throttled requests
  • Loading branch information
alextreme committed Sep 19, 2022
1 parent c63c680 commit b742df2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/open_inwoner/accounts/tests/test_password_reset_view.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
from django.core.cache import cache
from django.test import TestCase
from django.urls import reverse


class PasswordResetViewTests(TestCase):
def test_user_cant_access_the_password_reset_view_more_than_5_times(self):
url = reverse("admin_password_reset")
cache.clear()

for i in range(5):
response = self.client.get(url)
Expand Down

0 comments on commit b742df2

Please sign in to comment.