tests: Introduce send_huddle_message().

The tighter interface here makes for shorter lines (or
fewer multi-line calls) and it leads to stricter type
checking.
This commit is contained in:
Steve Howell
2017-10-27 10:53:08 -07:00
parent 9707767b21
commit 4b78f69a87
2 changed files with 18 additions and 9 deletions

View File

@@ -421,6 +421,19 @@ class ZulipTestCase(TestCase):
content
)
def send_huddle_message(self, from_email, to_emails, content=u"test content"):
# type: (Text, List[Text], Text) -> int
sender = get_user_profile_by_email(from_email)
assert(len(to_emails) >= 2)
(sending_client, _) = Client.objects.get_or_create(name="test suite")
return check_send_message(
sender, sending_client, 'private', to_emails, None,
content
)
def send_stream_message(self, sender_email, stream_name,
content=u"test content", topic_name=u"test"):
# type: (Text, Text, Text, Text) -> int