Commit 6dfc490f by Vik Paruchuri

Json updates

parent df07192a
......@@ -85,11 +85,7 @@ class TestStaffGradingService(LoginEnrollmentTestCase):
r = self.check_for_post_code(200, url, data)
d = r.content
try:
d = json.loads(d)
except Exception:
pass
d = json.loads(r.content)
self.assertTrue(d['success'])
self.assertEquals(d['submission_id'], self.mock_service.cnt)
......@@ -118,11 +114,7 @@ class TestStaffGradingService(LoginEnrollmentTestCase):
data.update({'skipped' : True})
r = self.check_for_post_code(200, url, data)
d = r.content
try:
d = json.loads(d)
except Exception:
pass
d = json.loads(r.content)
self.assertTrue(d['success'], str(d))
self.assertEquals(d['submission_id'], self.mock_service.cnt)
......@@ -139,11 +131,8 @@ class TestStaffGradingService(LoginEnrollmentTestCase):
data = {}
r = self.check_for_post_code(200, url, data)
d = r.content
try:
d = json.loads(d)
except Exception:
pass
d = json.loads(r.content)
self.assertTrue(d['success'], str(d))
self.assertIsNotNone(d['problem_list'])
......@@ -194,10 +183,7 @@ class TestPeerGradingService(LoginEnrollmentTestCase):
r = self.peer_module.get_next_submission(data)
d = r
try:
d = json.loads(d)
except Exception:
pass
self.assertTrue(d['success'])
self.assertIsNotNone(d['submission_id'])
self.assertIsNotNone(d['prompt'])
......@@ -232,10 +218,7 @@ class TestPeerGradingService(LoginEnrollmentTestCase):
r = self.peer_module.save_grade(qdict)
d = r
try:
d = json.loads(d)
except Exception:
pass
self.assertTrue(d['success'])
def test_save_grade_missing_keys(self):
......@@ -248,10 +231,7 @@ class TestPeerGradingService(LoginEnrollmentTestCase):
data = {'location': self.location}
r = self.peer_module.is_student_calibrated(data)
d = r
try:
d = json.loads(d)
except Exception:
pass
self.assertTrue(d['success'])
self.assertTrue('calibrated' in d)
......@@ -266,10 +246,7 @@ class TestPeerGradingService(LoginEnrollmentTestCase):
r = self.peer_module.show_calibration_essay(data)
d = r
try:
d = json.loads(r)
except Exception:
pass
self.assertTrue(d['success'])
self.assertIsNotNone(d['submission_id'])
self.assertIsNotNone(d['prompt'])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment