aboutsummaryrefslogtreecommitdiffstats
path: root/djangorestframework/tests
diff options
context:
space:
mode:
authorTom Christie2011-04-25 04:50:28 +0100
committerTom Christie2011-04-25 04:50:28 +0100
commit762a52edde09297e87c640797219c9bb8255d50a (patch)
treec68aff4f73e988fd2ee2cec827bd3ec528fa6e22 /djangorestframework/tests
parent84a4fd3ea11a55441cb5b8acd584c76fc325edcc (diff)
downloaddjango-rest-framework-762a52edde09297e87c640797219c9bb8255d50a.tar.bz2
Fix some compat issues with json/simplejson
Diffstat (limited to 'djangorestframework/tests')
-rw-r--r--djangorestframework/tests/authentication.py12
-rw-r--r--djangorestframework/tests/reverse.py5
2 files changed, 7 insertions, 10 deletions
diff --git a/djangorestframework/tests/authentication.py b/djangorestframework/tests/authentication.py
index c825883d..72300506 100644
--- a/djangorestframework/tests/authentication.py
+++ b/djangorestframework/tests/authentication.py
@@ -1,16 +1,15 @@
from django.conf.urls.defaults import patterns
from django.test import TestCase
from django.test import Client
-from djangorestframework.compat import RequestFactory
-from djangorestframework.resource import Resource
from django.contrib.auth.models import User
from django.contrib.auth import login
+from django.utils import simplejson as json
+
+from djangorestframework.compat import RequestFactory
+from djangorestframework.resource import Resource
import base64
-try:
- import json
-except ImportError:
- import simplejson as json
+
class MockResource(Resource):
def post(self, request):
@@ -86,3 +85,4 @@ class SessionAuthTests(TestCase):
"""Ensure POSTing form over session authentication without logged in user fails."""
response = self.csrf_client.post('/', {'example': 'example'})
self.assertEqual(response.status_code, 403)
+
diff --git a/djangorestframework/tests/reverse.py b/djangorestframework/tests/reverse.py
index 1f9071b3..28fee63b 100644
--- a/djangorestframework/tests/reverse.py
+++ b/djangorestframework/tests/reverse.py
@@ -1,13 +1,10 @@
from django.conf.urls.defaults import patterns, url
from django.core.urlresolvers import reverse
from django.test import TestCase
+from django.utils import simplejson as json
from djangorestframework.resource import Resource
-try:
- import json
-except ImportError:
- import simplejson as json
class MockResource(Resource):