tests: Clean up and extend topic links tests in test_messages.

This is a follow-up to b69213808a.
We now actually send messages from the notification_bot, which
is the real usecase for this code.

Also, this cleans up the code and removes needless asserts like
`assertNotEqual(zulip_realm, lear_realm)` making the test easier
to read.
This commit is contained in:
Rohitt Vashishtha
2019-10-15 20:53:28 +00:00
committed by Tim Abbott
parent 2504d9ffc9
commit 5fd0a121ea
3 changed files with 23 additions and 41 deletions

View File

@@ -2046,9 +2046,9 @@ def extract_emails(emails: Iterable[str]) -> List[str]:
return recipients
def check_send_stream_message(sender: UserProfile, client: Client, stream_name: str,
topic: str, body: str) -> int:
topic: str, body: str, realm: Optional[Realm]=None) -> int:
addressee = Addressee.for_stream_name(stream_name, topic)
message = check_message(sender, client, addressee, body)
message = check_message(sender, client, addressee, body, realm)
return do_send_messages([message])[0]