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)
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)
def test_get_cool_off_threshold_error(self): with self.assertRaises(TypeError): get_cool_off_threshold()