diff options
| author | Tom Christie | 2012-08-24 20:57:10 +0100 |
|---|---|---|
| committer | Tom Christie | 2012-08-24 20:57:10 +0100 |
| commit | 87b363f7bc5f73d850df123a61895d65ec0b05e7 (patch) | |
| tree | 1993adba1ad6a01c498c883babb157e3b4c7ee15 /djangorestframework/tests | |
| parent | 4e4584a01a4cf67c23aec21088110cd477ba841b (diff) | |
| download | django-rest-framework-87b363f7bc5f73d850df123a61895d65ec0b05e7.tar.bz2 | |
Remove PermissionsMixin
Diffstat (limited to 'djangorestframework/tests')
| -rw-r--r-- | djangorestframework/tests/authentication.py | 2 | ||||
| -rw-r--r-- | djangorestframework/tests/renderers.py | 1 | ||||
| -rw-r--r-- | djangorestframework/tests/throttling.py | 14 |
3 files changed, 9 insertions, 8 deletions
diff --git a/djangorestframework/tests/authentication.py b/djangorestframework/tests/authentication.py index 5debc79a..24c59488 100644 --- a/djangorestframework/tests/authentication.py +++ b/djangorestframework/tests/authentication.py @@ -12,7 +12,7 @@ import base64 class MockView(View): - permissions_classes = (permissions.IsAuthenticated,) + permission_classes = (permissions.IsAuthenticated,) def post(self, request): return HttpResponse({'a': 1, 'b': 2, 'c': 3}) diff --git a/djangorestframework/tests/renderers.py b/djangorestframework/tests/renderers.py index 0e160606..610457c7 100644 --- a/djangorestframework/tests/renderers.py +++ b/djangorestframework/tests/renderers.py @@ -4,7 +4,6 @@ from django.conf.urls.defaults import patterns, url, include from django.test import TestCase from djangorestframework import status -from djangorestframework.compat import View as DjangoView from djangorestframework.response import Response from djangorestframework.views import View from djangorestframework.renderers import BaseRenderer, JSONRenderer, YAMLRenderer, \ diff --git a/djangorestframework/tests/throttling.py b/djangorestframework/tests/throttling.py index 73a4c02b..8c5457d3 100644 --- a/djangorestframework/tests/throttling.py +++ b/djangorestframework/tests/throttling.py @@ -12,25 +12,28 @@ from djangorestframework.permissions import PerUserThrottling, PerViewThrottling from djangorestframework.resources import FormResource from djangorestframework.response import Response + class MockView(View): - permissions_classes = ( PerUserThrottling, ) + permission_classes = (PerUserThrottling,) throttle = '3/sec' def get(self, request): return Response('foo') + class MockView_PerViewThrottling(MockView): - permissions_classes = ( PerViewThrottling, ) + permission_classes = (PerViewThrottling,) + class MockView_PerResourceThrottling(MockView): - permissions_classes = ( PerResourceThrottling, ) + permission_classes = (PerResourceThrottling,) resource = FormResource + class MockView_MinuteThrottling(MockView): throttle = '3/min' - class ThrottlingTests(TestCase): urls = 'djangorestframework.tests.throttling' @@ -54,7 +57,7 @@ class ThrottlingTests(TestCase): """ Explicitly set the timer, overriding time.time() """ - view.permissions_classes[0].timer = lambda self: value + view.permission_classes[0].timer = lambda self: value def test_request_throttling_expires(self): """ @@ -101,7 +104,6 @@ class ThrottlingTests(TestCase): """ self.ensure_is_throttled(MockView_PerResourceThrottling, 503) - def ensure_response_header_contains_proper_throttle_field(self, view, expected_headers): """ Ensure the response returns an X-Throttle field with status and next attributes |
