mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-07-28 17:09:59 +03:00
Use default argument of max() and change test name
This commit is contained in:
parent
957b39fa8d
commit
8e6ee98ee9
|
@ -363,7 +363,7 @@ class APIView(View):
|
|||
if duration is not None
|
||||
]
|
||||
|
||||
duration = max(durations) if durations else None
|
||||
duration = max(durations, default=None)
|
||||
self.throttled(request, duration)
|
||||
|
||||
def determine_version(self, request, *args, **kwargs):
|
||||
|
|
|
@ -159,7 +159,7 @@ class ThrottlingTests(TestCase):
|
|||
assert response.status_code == 429
|
||||
assert int(response['retry-after']) == 58
|
||||
|
||||
def test_handle_negative_throttle_value(self):
|
||||
def test_throttle_rate_change_negative(self):
|
||||
self.set_throttle_timer(MockView_DoubleThrottling, 0)
|
||||
request = self.factory.get('/')
|
||||
for dummy in range(24):
|
||||
|
|
Loading…
Reference in New Issue
Block a user