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:
Steve Howell
2020-08-24 15:32:54 +00:00
committed by Tim Abbott
parent fbef6e3c03
commit 0f970c6971

View File

@@ -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