diff --git a/rest_framework/throttling.py b/rest_framework/throttling.py index 92bb9cd1c..5f0272c10 100644 --- a/rest_framework/throttling.py +++ b/rest_framework/throttling.py @@ -5,6 +5,7 @@ import time from django.core.cache import cache as default_cache from django.core.exceptions import ImproperlyConfigured + from rest_framework.settings import api_settings from rest_framework.utils.throttling_duration_parser import ( parse_quantity_and_unit diff --git a/tests/test_throttling.py b/tests/test_throttling.py index 2cfdecd4f..dbbaf9453 100644 --- a/tests/test_throttling.py +++ b/tests/test_throttling.py @@ -468,7 +468,7 @@ class SimpleRateThrottleTests(TestCase): def test_parse_rate_returns_tuple_with_none_if_rate_not_provided(self): rate = SimpleRateThrottle().parse_rate(None) assert rate == (None, None) - + def test_parse_quantity_and_unit_parses_correctly(self): result = parse_quantity_and_unit("5min") assert result == (5, 'min')