test_classes: Fix bug where UserProfile could be passed to client_post.

It would cause JSON overflow error while producing URL coverage report.
This commit is contained in:
Mateusz Mandera
2020-01-30 17:25:01 +01:00
committed by Tim Abbott
parent f8f57bdfcc
commit 682dea1b34

View File

@@ -859,7 +859,8 @@ class WebhookTestCase(ZulipTestCase):
headers = get_fixture_http_headers(self.FIXTURE_DIR_NAME, fixture_name)
headers = standardize_headers(headers)
kwargs.update(headers)
sender = kwargs.get('sender', self.test_user)
# The sender profile shouldn't be passed any further in kwargs, so we pop it.
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)