python: Replace ujson with orjson.

Fixes #6507.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg
2020-08-06 16:09:47 -07:00
committed by Tim Abbott
parent 123790a72d
commit 61d0417e75
132 changed files with 1319 additions and 1238 deletions

View File

@@ -1,7 +1,7 @@
from typing import Any, Callable, Dict, Optional
from unittest import mock
import ujson
import orjson
from django.test import override_settings
from django.utils.html import escape
from requests.exceptions import ConnectionError
@@ -48,7 +48,7 @@ class OembedTestCase(ZulipTestCase):
'version': '1.0',
'width': 658,
'height': 400}
response.text = ujson.dumps(response_data)
response.text = orjson.dumps(response_data).decode()
url = 'http://instagram.com/p/BLtI2WdAymy'
data = get_oembed_data(url)
self.assertIsInstance(data, dict)
@@ -72,7 +72,7 @@ class OembedTestCase(ZulipTestCase):
'version': '1.0',
'width': 658,
'height': 400}
response.text = ujson.dumps(response_data)
response.text = orjson.dumps(response_data).decode()
url = 'http://imgur.com/photo/158727223'
data = get_oembed_data(url)
self.assertIsInstance(data, dict)
@@ -96,7 +96,7 @@ class OembedTestCase(ZulipTestCase):
'version': '1.0',
'width': 658,
'height': 400}
response.text = ujson.dumps(response_data)
response.text = orjson.dumps(response_data).decode()
url = 'http://blip.tv/video/158727223'
data = get_oembed_data(url)
self.assertIsInstance(data, dict)