mirror of
https://github.com/zulip/zulip.git
synced 2025-11-01 20:44:04 +00:00
test_hooks: Use send_json_payload for private message tests.
This commit is contained in:
@@ -423,7 +423,9 @@ class AuthedTestCase(TestCase):
|
||||
# Check the correct message was sent
|
||||
msg = self.get_last_message()
|
||||
self.assertEqual(msg.sender.email, email)
|
||||
self.assertEqual(get_display_recipient(msg.recipient), stream_name)
|
||||
if stream_name is not None:
|
||||
self.assertEqual(get_display_recipient(msg.recipient), stream_name)
|
||||
# TODO: should also validate recipient for private messages
|
||||
|
||||
return msg
|
||||
|
||||
|
||||
@@ -45,12 +45,12 @@ class WebhookTestCase(AuthedTestCase):
|
||||
if content_type is not None:
|
||||
kwargs['content_type'] = content_type
|
||||
|
||||
result = self.client.post(self.url, payload, content_type=content_type)
|
||||
self.assert_json_success(result)
|
||||
|
||||
msg = self.get_last_message()
|
||||
msg = self.send_json_payload(self.TEST_USER_EMAIL, self.url, payload,
|
||||
stream_name=None, **kwargs)
|
||||
self.do_test_message(msg, expected_message)
|
||||
|
||||
return msg
|
||||
|
||||
def build_webhook_url(self):
|
||||
# type: () -> text_type
|
||||
api_key = self.get_api_key(self.TEST_USER_EMAIL)
|
||||
|
||||
Reference in New Issue
Block a user