mirror of
https://github.com/zulip/zulip.git
synced 2025-11-06 06:53:25 +00:00
Add integration for Yo App.
[includes some small tweaks by tabbott]
This commit is contained in:
committed by
Tim Abbott
parent
44ed9da7f0
commit
f3d03d89b4
@@ -932,3 +932,24 @@ class PingdomHookTests(AuthedTestCase):
|
||||
|
||||
def _send_post_request_with_params(self, json):
|
||||
return self.client.post(self._url, json, stream_name=self.STREAM_NAME, content_type="application/json")
|
||||
|
||||
class YoHookTests(AuthedTestCase):
|
||||
def test_yo_message(self):
|
||||
"""
|
||||
Yo App sends notification whenever user receives a new Yo from another user.
|
||||
"""
|
||||
bot_email = "hamlet@zulip.com"
|
||||
api_key = self.get_api_key(bot_email)
|
||||
body = ""
|
||||
|
||||
email = "cordelia@zulip.com"
|
||||
sender = "IAGO"
|
||||
ip = "127.0.0.1"
|
||||
url = "/api/v1/external/yo?email=%s&api_key=%s&username=%s&user_ip=%s" % (email, api_key, sender, ip)
|
||||
|
||||
self.client.get(url,
|
||||
body,
|
||||
content_type="application/x-www-form-urlencoded")
|
||||
|
||||
msg = Message.objects.filter().order_by('-id')[0]
|
||||
self.assertEqual(msg.content, (u"Yo from IAGO"))
|
||||
|
||||
Reference in New Issue
Block a user