Use default argument of max() and change test name

This commit is contained in:
Christopher Grebs 2019-08-07 10:48:15 +02:00
parent 957b39fa8d
commit 8e6ee98ee9
No known key found for this signature in database
GPG Key ID: D7BCDE311BFC58DD
2 changed files with 2 additions and 2 deletions

View File

@ -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):

View File

@ -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):