test_classes: Improve error handling for send_message.

This commit is contained in:
Tim Abbott
2017-09-27 12:00:58 -07:00
parent f397925df2
commit c3911e3fb6

View File

@@ -377,8 +377,10 @@ class ZulipTestCase(TestCase):
sender = get_user_profile_by_email(sender_name)
if message_type in [Recipient.PERSONAL, Recipient.HUDDLE]:
message_type_name = "private"
else:
elif message_type == Recipient.STREAM:
message_type_name = "stream"
else:
raise AssertionError("Recipient type should be an Recipient.STREAM type enum")
if isinstance(raw_recipients, six.string_types):
recipient_list = [raw_recipients]
else: