예제 #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)
예제 #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)
예제 #3
0
 def test_get_cool_off_threshold_error(self):
     with self.assertRaises(TypeError):
         get_cool_off_threshold()
예제 #4
0
 def test_get_cool_off_threshold_error(self):
     with self.assertRaises(TypeError):
         get_cool_off_threshold()