We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c894543 commit 65fc737Copy full SHA for 65fc737
tests/sentry/api/test_handlers.py
@@ -1,5 +1,7 @@
1
from __future__ import absolute_import
2
3
+import math
4
+
5
from django.conf.urls import url
6
from django.test import override_settings
7
from rest_framework.permissions import AllowAny
@@ -27,4 +29,10 @@ def test_simple(self):
27
29
self.login_as(self.user)
28
30
resp = self.get_response()
31
assert resp.status_code == 429
- assert resp.data["detail"] == "Request was throttled. Expected available in 1.0 second."
32
33
+ # DRF ceils our configured wait time, this produces a different number
34
+ # type between 2 and 3. In 2 this produces a float, in 3 this produces
35
+ # an integer.
36
+ assert resp.data[
37
+ "detail"
38
+ ] == u"Request was throttled. Expected available in {} second.".format(math.ceil(1))
0 commit comments