diff options
| author | Tom Christie | 2011-06-02 12:58:10 +0100 |
|---|---|---|
| committer | Tom Christie | 2011-06-02 12:58:10 +0100 |
| commit | b50492853f537a2473bb0a9eea86c8b0ed6b8824 (patch) | |
| tree | d289d39aacf187a8a0696a4c1c863aabe1472c3a /djangorestframework/tests/reverse.py | |
| parent | 7ee9adbe5c03c29cd4a894dd476548f7fe73b5e4 (diff) | |
| parent | fc1640de75511006e89f033c9270ec91a9f1e4d4 (diff) | |
| download | django-rest-framework-b50492853f537a2473bb0a9eea86c8b0ed6b8824.tar.bz2 | |
pull in -dev as 0.2.0
Diffstat (limited to 'djangorestframework/tests/reverse.py')
| -rw-r--r-- | djangorestframework/tests/reverse.py | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/djangorestframework/tests/reverse.py b/djangorestframework/tests/reverse.py index 2718ebca..b4b0a793 100644 --- a/djangorestframework/tests/reverse.py +++ b/djangorestframework/tests/reverse.py @@ -3,19 +3,19 @@ from django.core.urlresolvers import reverse from django.test import TestCase from django.utils import simplejson as json -from djangorestframework.resource import Resource +from djangorestframework.views import View -class MockResource(Resource): +class MockView(View): """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, auth): + def get(self, request): return reverse('another') urlpatterns = patterns('', - url(r'^$', MockResource.as_view()), - url(r'^another$', MockResource.as_view(), name='another'), + url(r'^$', MockView.as_view()), + url(r'^another$', MockView.as_view(), name='another'), ) @@ -24,5 +24,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') |
