aboutsummaryrefslogtreecommitdiffstats
path: root/rest_framework/tests/test_throttling.py
diff options
context:
space:
mode:
authorDmitry Mukhin2014-04-07 20:31:12 +0400
committerDmitry Mukhin2014-04-07 20:31:12 +0400
commitc3891b6e00daa7a92cca1c88599e046f72926bb4 (patch)
tree201120791360e16fa8fdea1ce688223801ce09ed /rest_framework/tests/test_throttling.py
parent115fe04842b58226b9fa29069b95af7df62b046a (diff)
downloaddjango-rest-framework-c3891b6e00daa7a92cca1c88599e046f72926bb4.tar.bz2
set Retry-After header when throttled
Diffstat (limited to 'rest_framework/tests/test_throttling.py')
-rw-r--r--rest_framework/tests/test_throttling.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/rest_framework/tests/test_throttling.py b/rest_framework/tests/test_throttling.py
index 41bff692..b5ae02cd 100644
--- a/rest_framework/tests/test_throttling.py
+++ b/rest_framework/tests/test_throttling.py
@@ -117,8 +117,10 @@ class ThrottlingTests(TestCase):
response = view.as_view()(request)
if expect is not None:
self.assertEqual(response['X-Throttle-Wait-Seconds'], expect)
+ self.assertEqual(response['Retry-After'], expect)
else:
self.assertFalse('X-Throttle-Wait-Seconds' in response)
+ self.assertFalse('Retry-After' in response)
def test_seconds_fields(self):
"""
@@ -165,11 +167,13 @@ class ThrottlingTests(TestCase):
response = MockView_NonTimeThrottling.as_view()(request)
self.assertFalse('X-Throttle-Wait-Seconds' in response)
+ self.assertFalse('Retry-After' in response)
self.assertTrue(MockView_NonTimeThrottling.throttle_classes[0].called)
response = MockView_NonTimeThrottling.as_view()(request)
self.assertFalse('X-Throttle-Wait-Seconds' in response)
+ self.assertFalse('Retry-After' in response)
class ScopedRateThrottleTests(TestCase):