diff options
Diffstat (limited to 'djangorestframework/tests')
| -rw-r--r-- | djangorestframework/tests/accept.py | 5 | ||||
| -rw-r--r-- | djangorestframework/tests/authentication.py | 2 | ||||
| -rw-r--r-- | djangorestframework/tests/files.py | 2 | ||||
| -rw-r--r-- | djangorestframework/tests/reverse.py | 8 |
4 files changed, 11 insertions, 6 deletions
diff --git a/djangorestframework/tests/accept.py b/djangorestframework/tests/accept.py index 726e1252..b12dc757 100644 --- a/djangorestframework/tests/accept.py +++ b/djangorestframework/tests/accept.py @@ -18,10 +18,13 @@ class UserAgentMungingTest(TestCase): http://www.gethifi.com/blog/browser-rest-http-accept-headers""" def setUp(self): + class MockResource(Resource): - anon_allowed_methods = allowed_methods = ('GET',) + permissions = () + def get(self, request): return {'a':1, 'b':2, 'c':3} + self.req = RequestFactory() self.MockResource = MockResource self.view = MockResource.as_view() diff --git a/djangorestframework/tests/authentication.py b/djangorestframework/tests/authentication.py index b2bc4446..c825883d 100644 --- a/djangorestframework/tests/authentication.py +++ b/djangorestframework/tests/authentication.py @@ -13,8 +13,6 @@ except ImportError: import simplejson as json class MockResource(Resource): - allowed_methods = ('POST',) - def post(self, request): return {'a':1, 'b':2, 'c':3} diff --git a/djangorestframework/tests/files.py b/djangorestframework/tests/files.py index dd4689a6..4dc3aa40 100644 --- a/djangorestframework/tests/files.py +++ b/djangorestframework/tests/files.py @@ -16,7 +16,7 @@ class UploadFilesTests(TestCase): file = forms.FileField class MockResource(Resource): - allowed_methods = anon_allowed_methods = ('POST',) + permissions = () form = FileForm def post(self, request, *args, **kwargs): diff --git a/djangorestframework/tests/reverse.py b/djangorestframework/tests/reverse.py index f6a3ea51..1f9071b3 100644 --- a/djangorestframework/tests/reverse.py +++ b/djangorestframework/tests/reverse.py @@ -12,7 +12,7 @@ except ImportError: class MockResource(Resource): """Mock resource which simply returns a URL, so that we can ensure that reversed URLs are fully qualified""" - anon_allowed_methods = ('GET',) + permissions = () def get(self, request): return reverse('another') @@ -28,5 +28,9 @@ class ReverseTests(TestCase): urls = 'djangorestframework.tests.reverse' def test_reversed_urls_are_fully_qualified(self): - response = self.client.get('/') + try: + response = self.client.get('/') + except: + import traceback + traceback.print_exc() self.assertEqual(json.loads(response.content), 'http://testserver/another') |
