From 2b7bb6e965d22ecefb460b7d9d2f949939580e13 Mon Sep 17 00:00:00 2001 From: Umair Khan Date: Thu, 17 Aug 2017 11:39:59 +0500 Subject: [PATCH] result.json: Upgrade test_events. --- zerver/tests/test_events.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/zerver/tests/test_events.py b/zerver/tests/test_events.py index 8966741a7c..cc1e219698 100644 --- a/zerver/tests/test_events.py +++ b/zerver/tests/test_events.py @@ -148,7 +148,7 @@ class EventsEndpointTest(ZulipTestCase): result = self.client_post('/json/register', dict(event_types=ujson.dumps(['pointer'])), **self.api_auth(email)) self.assert_json_success(result) - result_dict = ujson.loads(result.content) + result_dict = result.json() self.assertEqual(result_dict['last_event_id'], -1) self.assertEqual(result_dict['queue_id'], '15:11') @@ -165,7 +165,7 @@ class EventsEndpointTest(ZulipTestCase): **self.api_auth(email)) self.assert_json_success(result) - result_dict = ujson.loads(result.content) + result_dict = result.json() self.assertEqual(result_dict['last_event_id'], 6) self.assertEqual(result_dict['pointer'], 15) self.assertEqual(result_dict['queue_id'], '15:12') @@ -178,7 +178,7 @@ class EventsEndpointTest(ZulipTestCase): fetch_event_types=ujson.dumps(['message'])), **self.api_auth(email)) self.assert_json_success(result) - result_dict = ujson.loads(result.content) + result_dict = result.json() self.assertEqual(result_dict['last_event_id'], 6) # Check that the message event types data is in there self.assertIn('max_message_id', result_dict) @@ -193,7 +193,7 @@ class EventsEndpointTest(ZulipTestCase): event_types=ujson.dumps(['message'])), **self.api_auth(email)) self.assert_json_success(result) - result_dict = ujson.loads(result.content) + result_dict = result.json() self.assertEqual(result_dict['last_event_id'], 6) # Check that we didn't fetch the messages data self.assertNotIn('max_message_id', result_dict)