コード例 #1
0
ファイル: tests.py プロジェクト: vishnevski/django-axes
 def test_login_max(self, correct_username=False):
     for i in range(0, gs("FAILURE_LIMIT") - 1):
         response = self._attempt_login(correct_username=correct_username)
         self.assertContains(response, "this_is_the_login_form")
     # So, we shouldn't have gotten a lock-out yet.
     # But we should get one now
     response = self._attempt_login()
     self.assertContains(response, "Account locked")
コード例 #2
0
ファイル: tests.py プロジェクト: vishnevski/django-axes
 def test_login_max_with_more(self, correct_username=False):
     for i in range(0, gs("FAILURE_LIMIT") - 1):
         response = self._attempt_login(correct_username=correct_username)
         self.assertContains(response, "this_is_the_login_form")
     # So, we shouldn't have gotten a lock-out yet.
     # But we should get one now
     for i in range(0, random.randrange(1, 100)):
         # try to log in a bunch of times
         response = self._attempt_login()
         self.assertContains(response, "Account locked")