diff contests/tests/view_tests.py @ 679:89b240fe9297

For Django 1.5.2: import json; django.utils.simplejson is deprecated.
author Brian Neal <bgneal@gmail.com>
date Thu, 15 Aug 2013 20:14:33 -0500
parents ee87ea74d46b
children
line wrap: on
line diff
--- a/contests/tests/view_tests.py	Wed Aug 14 14:53:21 2013 -0500
+++ b/contests/tests/view_tests.py	Thu Aug 15 20:14:33 2013 -0500
@@ -3,10 +3,11 @@
 
 """
 import datetime
+import json
+
 from django.test import TestCase
 from django.contrib.auth.models import User
 from django.core.urlresolvers import reverse
-from django.utils import simplejson
 
 from contests.models import Contest
 
@@ -81,8 +82,8 @@
                 HTTP_X_REQUESTED_WITH='XMLHttpRequest')
         self.assertEqual(response.status_code, 200)
 
-        json = simplejson.loads(response.content)
-        self.assertTrue(json['entered'])
+        c = json.loads(response.content)
+        self.assertTrue(c['entered'])
 
         contest = Contest.objects.get(pk=self.contest_id)
         self.assertTrue(self.user in contest.contestants.all())
@@ -92,8 +93,8 @@
                 HTTP_X_REQUESTED_WITH='XMLHttpRequest')
         self.assertEqual(response.status_code, 200)
 
-        json = simplejson.loads(response.content)
-        self.failIf(json['entered'])
+        c = json.loads(response.content)
+        self.failIf(c['entered'])
 
         contest = Contest.objects.get(pk=self.contest_id)
         self.failIf(self.user in contest.contestants.all())