mirror of
https://github.com/zulip/zulip.git
synced 2025-11-03 13:33:24 +00:00
This prep commit adds a lib function 'is_same_server_message_link'. This will be currently used while compressing quote and reply in push notifications and later can be used at other places.
14 lines
465 B
Python
14 lines
465 B
Python
import orjson
|
|
|
|
from zerver.lib.test_classes import ZulipTestCase
|
|
from zerver.lib.url_decoding import is_same_server_message_link
|
|
|
|
|
|
class URLDecodeTest(ZulipTestCase):
|
|
def test_is_same_server_message_link(self) -> None:
|
|
tests = orjson.loads(self.fixture_data("message_link_test_cases.json"))
|
|
for test in tests:
|
|
self.assertEqual(
|
|
is_same_server_message_link(test["message_link"]), test["expected_output"]
|
|
)
|