diff options
| author | Tom Christie | 2015-02-09 17:56:25 +0000 |
|---|---|---|
| committer | Tom Christie | 2015-02-09 17:56:25 +0000 |
| commit | 873fb69395de6fd230e4aba1b707c1f1979c0f07 (patch) | |
| tree | 3ba0bdc1bbb21fcb7e36c37cd6170112c94a7054 /tests/test_throttling.py | |
| parent | 235b98e427e2bae2b52fb386a42c8045724de251 (diff) | |
| parent | 1a087c8c5bac6f157979ef9ff540c0eb23848fb4 (diff) | |
| download | django-rest-framework-873fb69395de6fd230e4aba1b707c1f1979c0f07.tar.bz2 | |
Merge pull request #2530 from tomchristie/attribute-proxying-fix
Fix misleading `AttributeError` tracebacks on `Request` objects.
Diffstat (limited to 'tests/test_throttling.py')
| -rw-r--r-- | tests/test_throttling.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/test_throttling.py b/tests/test_throttling.py index cc36a004..50a53b3e 100644 --- a/tests/test_throttling.py +++ b/tests/test_throttling.py @@ -188,7 +188,9 @@ class ScopedRateThrottleTests(TestCase): class XYScopedRateThrottle(ScopedRateThrottle): TIMER_SECONDS = 0 THROTTLE_RATES = {'x': '3/min', 'y': '1/min'} - timer = lambda self: self.TIMER_SECONDS + + def timer(self): + return self.TIMER_SECONDS class XView(APIView): throttle_classes = (XYScopedRateThrottle,) @@ -290,7 +292,9 @@ class XffTestingBase(TestCase): class Throttle(ScopedRateThrottle): THROTTLE_RATES = {'test_limit': '1/day'} TIMER_SECONDS = 0 - timer = lambda self: self.TIMER_SECONDS + + def timer(self): + return self.TIMER_SECONDS class View(APIView): throttle_classes = (Throttle,) |
