tests: Test notification bot can send to private streams.

This commit is contained in:
Steve Howell 2018-08-14 15:53:42 +00:00 committed by Tim Abbott
parent 9a7a93c80b
commit 2dbd11ba9d
1 changed files with 18 additions and 0 deletions

View File

@ -1619,6 +1619,24 @@ class MessagePOSTTest(ZulipTestCase):
result = self.api_post(bot.email, "/api/v1/messages", payload) result = self.api_post(bot.email, "/api/v1/messages", payload)
self.assert_json_success(result) self.assert_json_success(result)
def test_notification_bot(self) -> None:
sender = self.notification_bot()
stream_name = 'private_stream'
self.make_stream(stream_name, invite_only=True)
payload = dict(
type="stream",
to=stream_name,
sender=sender.email,
client='test suite',
subject='whatever',
content='whatever',
)
result = self.api_post(sender.email, "/api/v1/messages", payload)
self.assert_json_success(result)
class ScheduledMessageTest(ZulipTestCase): class ScheduledMessageTest(ZulipTestCase):
def last_scheduled_message(self) -> ScheduledMessage: def last_scheduled_message(self) -> ScheduledMessage: