mirror of
https://github.com/zulip/zulip.git
synced 2025-11-03 13:33:24 +00:00
minor: Avoid do_test_message.
This function is a bad idea, as it leads to a possible situation
where you aren't actually testing anything:
def do_test_message(self, msg: Message, expected_message: Optional[str]) -> None:
if expected_message is not None:
self.assertEqual(msg.content, expected_message)
Unfortunately, it's called deep in the stack in some places, but
we can safely replace it with assertEqual here.
This commit is contained in:
@@ -1040,7 +1040,7 @@ class WebhookTestCase(ZulipTestCase):
|
||||
sender = kwargs.pop('sender', self.test_user)
|
||||
msg = self.send_json_payload(sender, self.url, payload,
|
||||
stream_name=None, **kwargs)
|
||||
self.do_test_message(msg, expected_message)
|
||||
self.assertEqual(msg.content, expected_message)
|
||||
|
||||
return msg
|
||||
|
||||
|
||||
Reference in New Issue
Block a user