Example #1
0
    def test_get_cool_off_threshold(self):
        timestamp = now()

        with patch('axes.attempts.now', return_value=timestamp):
            attempt_time = timestamp
            threshold_now = get_cool_off_threshold(attempt_time)

            attempt_time = None
            threshold_none = get_cool_off_threshold(attempt_time)

        self.assertEqual(threshold_now, threshold_none)
Example #2
0
    def test_get_cool_off_threshold(self):
        timestamp = now()

        with patch("axes.attempts.now", return_value=timestamp):
            attempt_time = timestamp
            threshold_now = get_cool_off_threshold(attempt_time)

            attempt_time = None
            threshold_none = get_cool_off_threshold(attempt_time)

        self.assertEqual(threshold_now, threshold_none)
Example #3
0
 def test_get_cool_off_threshold_error(self):
     with self.assertRaises(TypeError):
         get_cool_off_threshold()
Example #4
0
 def test_get_cool_off_threshold_error(self):
     with self.assertRaises(TypeError):
         get_cool_off_threshold()