mirror of
https://github.com/zulip/zulip.git
synced 2025-11-03 13:33:24 +00:00
wordpress: Fix nonsense tests.
‘stream_name’ is not a cromulent keyword argument for client_post(), ‘unknown_action’ is malformed application/x-www-form-urlencoded, and these two tests were duplicates of each other with different comments. I’m not sure what they were intended to test, but here’s a guess. Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
committed by
Alex Vandiver
parent
ede6699d83
commit
3321a81c4a
@@ -92,11 +92,11 @@ class WordPressHookTests(WebhookTestCase):
|
||||
self.subscribe(self.test_user, self.STREAM_NAME)
|
||||
|
||||
# post to the webhook url
|
||||
post_params = {
|
||||
"stream_name": self.STREAM_NAME,
|
||||
"content_type": "application/x-www-form-urlencoded",
|
||||
}
|
||||
result = self.client_post(self.url, "unknown_action", **post_params)
|
||||
result = self.client_post(
|
||||
self.url,
|
||||
self.get_body("unknown_action_no_data"),
|
||||
content_type="application/x-www-form-urlencoded",
|
||||
)
|
||||
|
||||
# check that we got the expected error message
|
||||
self.assert_json_error(result, "Unknown WordPress webhook action: WordPress action")
|
||||
@@ -107,11 +107,11 @@ class WordPressHookTests(WebhookTestCase):
|
||||
# params but without the hook parameter. This should also return an error.
|
||||
|
||||
self.subscribe(self.test_user, self.STREAM_NAME)
|
||||
post_params = {
|
||||
"stream_name": self.STREAM_NAME,
|
||||
"content_type": "application/x-www-form-urlencoded",
|
||||
}
|
||||
result = self.client_post(self.url, "unknown_action", **post_params)
|
||||
result = self.client_post(
|
||||
self.url,
|
||||
self.get_body("unknown_action_no_hook_provided"),
|
||||
content_type="application/x-www-form-urlencoded",
|
||||
)
|
||||
|
||||
self.assert_json_error(result, "Unknown WordPress webhook action: WordPress action")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user