aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_throttling.py
diff options
context:
space:
mode:
authorTom Christie2014-08-20 17:29:43 +0100
committerTom Christie2014-08-20 17:29:43 +0100
commit3de09f1df04115f142f3e77360fae9810a14be6c (patch)
tree542447dc3b795df0b80b6b9669826c01a159e767 /tests/test_throttling.py
parent6953a5ecec56d5eaffceef817316a742dcc2220c (diff)
parent3b07d0c9978335e183f369480618b48ff1e1b1ab (diff)
downloaddjango-rest-framework-3de09f1df04115f142f3e77360fae9810a14be6c.tar.bz2
Merge pull request #1508 from uploadcare/set-retry-after
set Retry-After header when throttled
Diffstat (limited to 'tests/test_throttling.py')
-rw-r--r--tests/test_throttling.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/test_throttling.py b/tests/test_throttling.py
index b0cb2fe7..7b696f07 100644
--- a/tests/test_throttling.py
+++ b/tests/test_throttling.py
@@ -118,8 +118,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):
"""
@@ -172,11 +174,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):